cmd not showing some files

2019-08-08 03:44发布

问题:

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.



标签: windows cmd