It's mostly to check if the program is available from the PATH Environment Variable.
I'd like to ask if this makes any sense and is a correct way to do that, or you have any improvements on that.
Code: Select all
@ECHO OFF
WHERE cmd.exe
IF ERRORLEVEL 01 ECHO the program is not found.
PAUSE
/Q argument can be added to silent the output of Where.exe program.
Code: Select all
WHERE /Q cmd.exe
Code: Select all
WHERE cmd.exe >NUL 2>NUL
The same above maybe can be rewritten as this:
Code: Select all
@ECHO OFF
WHERE cmd.exe || ECHO the program is not found.
PAUSE