I am trying to remove the banner lines from the PsInfo system information tool, but am getting what seems to me to be anomalous results.
I further want to restrict the output from PsInfo to specific lines, for which my usual FINDSTR string is "information Format NTFS".
In the test example, I am simply searching for the letters e and i, to select all (or almost all!) the lines passed to FINDSTR.
The batch file is:
psinfo -d disks 1>nul 2>con
psinfo -d disks 2>nul
psinfo -d disks 2>nul | findstr "e i"
and the output is
-----------
D:\>psinfo -d disks 1>nul
PsInfo v1.78 - Local and remote system information viewer
Copyright (C) 2001-2016 Mark Russinovich
Sysinternals -
www.sysinternals.com
Querying information for OnesPC...
D:\>psinfo -d disks 2>nul
System information for \\OnesPC:
Volume Type Format Label Size Free Free
C: Fixed NTFS OnesPC_C 49.43 GB 20.45 GB 41.4%
D: Fixed NTFS OnesPC_D 25.00 GB 24.05 GB 96.2%
V: CD-ROM 0.0%
D:\>psinfo -d disks 2>nul | findstr "e i"
PsInfo v1.78 - Local and remote system information viewer
Copyright (C) 2001-2016 Mark Russinovich
Sysinternals -
www.sysinternals.com
Querying information for OnesPC...
System information for \\OnesPC:
Volume Type Format Label Size Free Free
C: Fixed NTFS OnesPC_C 49.43 GB 20.45 GB 41.4%
D: Fixed NTFS OnesPC_D 25.00 GB 24.05 GB 96.2%
----------
The result for the final execution appears to me that the Pipe operator is taking the data from both stream 1 (SYSLOG) AND stream 2 (SYSERR), in spite of stream 2 having been redirected to NUL.
Is this another instance where I have misunderstood how things work?