@ECHO OFF SET FILE=%1 IF "%FILE%"=="" SET FILE=%COMPUTERNAME%-EventLogs.csv findstr.exe /c:",Security,517,System Event,," %FILE%