I currently have a batch statement that looks like this
findstr \"PreprocessorDefinitions=.*%D_KEYWORD%\" %PROJ% > nul 2>&1
if errorlevel 1 (
set D
Don't use a piping operator, which is what ">" is.
All programs have three streams:
command >nul
^ This says to pipe the standard-output stream to null.
command 2>nul
^ This says to pipe the standard-error stream to null.
command 2>&1
^ This says to pipe the standard-error stream to the same place as the standard-output stream.