How to capture the output of "pnputil.exe -e"

How can I get the output "% windir% / system32 / pnputil.exe -e"? (suppose Windows Vista is 32-bit)

Bonus for a technical explanation of why the application usually writes output to the cmd shell, but when the stdout and / or stderr redirection is redirected, does the application write nothing to the console or to stdout / stderr?

C: \ Windows \ System32> PnPutil.exe --help
Microsoft PnP Utility {...}

C: \ Windows \ System32> pnputil -e> c: \ foo.txt

C: \ Windows \ System32> type c: \ foo.txt

C: \ Windows \ System32> dir c: \ foo.txt
 Volume in drive C has no label.
 Volume Serial Number is XXXX-XXXX

 Directory of c: \

10/09/2008 12:10 PM 0 foo.txt
               1 File (s) 0 bytes
+3
9

, . WriteConsole . . .

, , . (, cmd , ).

+1

, , . MSDN WriteConsole , WriteConsole WriteFile. , pnputil.exe kernel32! WriteConsoleW kernel32! WriteConsoleInputW.

, .

, . .

+1

, pnputil.exe -a d:\pnpdriver *.inf

oemXX.inf , .

+1

, , ,

svn status | find "? "

- , svn status find "? ", subversion ( ) .

, svn , "Copyright? 2009", . , .

, , Sysinternals, , , - , .

/.

, > , , , . .

, .

0

, , "pnputil -e 2 > c:\foo.txt" . , .

0

. " > c:\foo.txt" , "2 > C:\foo.txt" , .

(2 > & 1), :

pnputil -e 1 > c:\foo.txt 2 > & 1

foo.txt, pnputil .

0

Expect Windows , , WriteConsole . Windows

0

( - > - > )

pnputil -e

; -

0
source

So, I'm looking for information of the same type and stumbled upon this: https://sysadminstricks.com/tricks/windows-tricks/cleaning-up-windows-driver-store-folder.html . Although the syntax is incorrect, it seems to have helped (with a little correction):

pnputil.exe -e > c:\driveroutput.txt

When this command is executed, it is not displayed on the command line, but it generates driveroutput.txtto the root C:. Opening a text file really shows that I now have the output of the listed OEM drivers on my PC.

0
source

Source: https://habr.com/ru/post/1696781/


All Articles