Set WshShell = CreateObject("WScript.shell")
WshShell.Run "cmd /K cd /d D:\Path\&abcd.bat"
wait 5
WshShell.SendKeys "{ENTER}"
这条线
WshShell.Run "cmd /K cd /d D:\Path\&abcd.bat"
工作正常,运行abcd.bat文件(运行文件,然后命令提示符要求按Enter键),但按Enter键
WshShell.SendKeys "{ENTER}"
不管用。 QTP / UFT没有做任何事情,并跳过这行代码并转移到下一行。
我试过了
WshShell.SendKeys "{ENTER}"
WshShell.SendKeys "~"
WshShell.SendKeys "(Chr(13))"
没有任何效果。