redirect

  • Thread starter Thread starter Praetorian Guard
  • Start date Start date
P

Praetorian Guard

The following code snippet can be used to detect if FINDSTR is available:

FINDSTR /? >NUL 2>&1
IF ERRORLEVEL 1 ECHO FINDSTR not available!What does 2>&1 mean?Thanks in
advance.
 
The following code snippet can be used to detect if FINDSTR is available:

FINDSTR /? >NUL 2>&1
IF ERRORLEVEL 1 ECHO FINDSTR not available!
What does 2>&1 mean?

It means to direct the STDERR stream (2) to the same place that the STDOUT
stream (1) is going.

In your example STDOUT is redirected to NUL and so the snippet redirects
STDERR to NUL also.
 
Back
Top