Here is something odd. When I run: Set oShell = CreateObject("WScript.Shell") oShell.run("C:\Windows\System32\PnPutil.exe") I get a 80070002 cannot find specified file. I know that file is there. So I ran: oShell.run("cmd /K C:\Windows\System32\PnPutil.exe") I get a command shell and browse to C:\Windows\System32. PnPutil.exe is not there. I can browse to the folder in explorer, it is there. What gives? Am I in an alternate cmd universe?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Probably you're running 32-bit cmd.exe on 64-bit Windows. %SystemRoot%\System32
gets redirected to %SystemRoot%\SysWow64
for 32-bit apps, which is where the 32-bit DLLs and EXEs reside (MSDN: File System Redirector). But there's no 32-bit version of PnPutil.exe. Try C:\Windows\Sysnative\PnPutil.exe
. The Sysnative
virtual directory lets 32-bit apps access the real System32
directory.