问题描述
这里有点奇怪.当我运行时:Set oShell = CreateObject("WScript.Shell")oShell.run("C:\Windows\System32\PnPutil.exe")我得到一个 80070002 找不到指定的文件.我知道那个文件在那里.所以我跑了:oShell.run("cmd/K C:\Windows\System32\PnPutil.exe")我得到一个命令外壳并浏览到 C:\Windows\System32.PnPutil.exe 不存在.我可以浏览到资源管理器中的文件夹,它就在那里.是什么赋予了?我在另一个 cmd 宇宙中吗?
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?
推荐答案
可能您正在 64 位 Windows 上运行 32 位 cmd.exe.对于 32 位应用程序,%SystemRoot%\System32
被重定向到 %SystemRoot%\SysWow64
,这是 32 位 DLL 和 EXE 所在的位置(MSDN:文件系统重定向器).但是没有 32 位版本的 PnPutil.exe.尝试 C:\Windows\Sysnative\PnPutil.exe
.Sysnative
虚拟目录允许 32 位应用访问真正的 System32
目录.
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.
这篇关于cmd不显示某些文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!