Skip to content

Instantly share code, notes, and snippets.

@the-nose-knows
Created July 3, 2017 23:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save the-nose-knows/1bebce2719e020188c6307cff736f951 to your computer and use it in GitHub Desktop.
Save the-nose-knows/1bebce2719e020188c6307cff736f951 to your computer and use it in GitHub Desktop.
@echo off
SETLOCAL ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
Set param1=5000
Set param2=300
FOR /F "tokens=*" %%Y IN (C:\temp\test_map.log) DO (
echo  Performing dry-run and file-inspection of %%~nxY
call C:\Windows\System32\notepad.exe %%Y %param1% %param2%
Set checker_exit=!errorlevel!
IF "!checker_exit!"=="0" (
echo %%~nxY exited zero, adding to test map
echo %%Y>>C:\temp\verified_test_map.log
)
IF "!checker_exit!"=="1" (
echo %%~nxY exited non-zero and non-halting, adding to test map
echo %%Y>>C:\temp\verified_test_map.log
)
IF "!checker_exit!"=="-1" echo %%~nxY had to be force-closed, skipping for this session
IF "!checker_exit!"=="-2" echo Bad parameters were sent to checker
IF "!checker_exit!"=="-3" echo %%~nxY Failed to even launch, possibly missing or unavailable to use
IF "!checker_exit!"=="-4" echo checker encountered an unknown internal error when trying it against %%~nxY
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment