pnputil console redirection problem under Vista

It seems to be that pnputil under Vista does not work with
redirection no matter what I do. Strange.

It works perfectly under Windows 7.

Any suggestions?

“pnputil -e” works fine and print out the results.
“pnputil -e | more” does not work, returns nothing.

“pnputil -e >myinf.txt” does not work.
“pnputil -e 2>myinf.txt” does not work.
“pnputil -e 2>stderr.txt>stdout.txt” does not work.
“pnputil -e 2>>stderr.txt>>stdout.txt” does not work.
All the above produce a 0 byte text file.

I also tried other things.
D:\work\libusb-win32\libusbwK\pnpfind>pnputil 2>pnputilhelp.txt
Microsoft PnP Utility
Usage:

pnputil.exe [-f | -i] [-? | -a | -d | -e]
Examples:
pnputil.exe -a a:\usbcam\USBCAM.INF -> Add package specified by USBCAM.INF
pnputil.exe -a c:\drivers*.inf -> Add all packages in c:\drivers<br>pnputil.exe -i -a a:\usbcam\USBCAM.INF -> Add and install driver package
pnputil.exe -e -> Enumerate all 3rd party packages
pnputil.exe -d oem0.inf -> Delete package oem0.inf
pnputil.exe -f -d oem0.inf -> Force delete package oem0.inf
pnputil.exe -? -> This usage screen

D:\work\libusb-win32\libusbwK\pnpfind>pnputil 1>pnputilhelp.txt

D:\work\libusb-win32\libusbwK\pnpfind>dir pnp*.txt
Volume in drive D is DATA
Volume Serial Number is 748A-B2F8

Directory of D:\work\libusb-win32\libusbwK\pnpfind

27/03/2011 07:05 PM 0 pnputilhelp.txt
1 File(s) 0 bytes
0 Dir(s) 44,022,108,160 bytes free

D:\work\libusb-win32\libusbwK\pnpfind>pnputil -? >pnputilhelp.txt 2>&1

D:\work\libusb-win32\libusbwK\pnpfind>dir pnp*.txt
Volume in drive D is DATA
Volume Serial Number is 748A-B2F8

Directory of D:\work\libusb-win32\libusbwK\pnpfind

27/03/2011 07:06 PM 0 pnputilhelp.txt
1 File(s) 0 bytes
0 Dir(s) 44,022,108,160 bytes free


Xiaofan

> It seems to be that pnputil under Vista does not work with

redirection no matter what I do. Strange.

Same on 2008 non-R2. The output file is always empty.

Write your own PnPUtil using SetupDI APIs.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

On Mon, Mar 28, 2011 at 9:01 PM, Maxim S. Shatskih
wrote:
>> It seems to be that pnputil under Vista does not work with
>> redirection no matter what I do. Strange.
>
> Same on 2008 non-R2. The output file is always empty.

Thanks for the confirmation.

> Write your own PnPUtil using SetupDI APIs.
>

That is probably we will do.

Just another information, we have looked at this one,
http://driverstoreexplorer.codeplex.com/
It looks quite nice and it does just what we want, but guess what?
It does not work with vista…


Xiaofan

On Mon, Mar 28, 2011 at 9:13 PM, Xiaofan Chen wrote:
> On Mon, Mar 28, 2011 at 9:01 PM, Maxim S. Shatskih
> wrote:
>>> It seems to be that pnputil under Vista does not work with
>>> redirection no matter what I do. Strange.
>>
>> Same on 2008 non-R2. The output file is always empty.
>
> Thanks for the confirmation.
>
>> Write your own PnPUtil using SetupDI APIs.
>>
>
> That is probably we will do.
>
> Just another information, we have looked at this one,
> http://driverstoreexplorer.codeplex.com/
> It looks quite nice and it does just what we want, but guess what?
> It does not work with vista…

Travis Robinson (current developer of libusb-win32 and libusbk)
has a working prototype (console version) now. Just wonder
if people are interested in this application or not? We can
publish it as a free utility.


Xiaofan

PS:
libusb-win32: http://sourceforge.net/projects/libusb-win32/
(WDM based, currently GPL)

libusbk: http://code.google.com/p/usb-travis/
(KMDF based, will be dual licensed under LGPL and BSD)