【发布时间】:2018-12-01 07:50:17
【问题描述】:
运行此命令时,我在 win 8.1 64bit 中遇到错误:
start "" "X:\Windows\System32\devmgmt.msc"
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.SendKeys "{TAP}"
pause
我收到此错误;
H:\Desktop>WshShell.SendKeys "{TAP}"
'WshShell.SendKeys' 不是内部或外部命令、可运行程序或批处理文件。
我已经安装了Java环境。
【问题讨论】:
-
您不能直接从命令提示符运行 WScript 命令,您可以通过
wscript.exe或cscript.exe使用 VBS 或 WSF 文件。您似乎不了解 WScript 是什么或如何使用它,否则您不会提到 Java 环境,这与以往的情况完全没有关系。建议你去找一个关于如何使用 Windows Scripting Host 的好教程。