@echo off cd %DEV_TOOLS%\SysinternalsSuite if exist %1\* ( echo Run on a file ) else ( if exist "%~1_Report.txt" ( del "%~1_Report.txt" ) sigcheck.exe /a "%~1" > "%~1_sigcheck_report.txt" start notepad "%~1_sigcheck_report.txt" )