我在下面创建的脚本打开了一些虚拟机,同时脚本正在运行本地计算机的键盘和鼠标被锁定,通过脚本CTRL ALT + F的快捷键输入。当脚本完成时,我希望键盘和鼠标使用相同的功能解锁。
请注意,即使键盘已锁定,用于解锁键盘和鼠标的热键仍处于活动状态,即CTRL、ALT + F。
该脚本运行良好,但没有解锁键盘和鼠标,请任何人看到此脚本的任何问题?
Dim shell
Set shell = wscript.CreateObject("Shell.Application")
set x = CreateObject("Wscript.shell")
x.sendkeys("^%{f}")
shell.Open "C:\Program Files\Oracle\VirtualBox\VirtualBox.exe"
WScript.Sleep 3000
shell.Open
"\\leeds.smoothwall.net\DFS\homefolder\steve.newton\Documents\Local
Automation scripts\VBS files\Paths\NetworkGuardian.lnk"
WScript.Sleep 120000
shell.Open
"\\leeds.smoothwall.net\DFS\homefolder\steve.newton\Documents\Local
Automation scripts\VBS files\Paths\IE11 - Win10 Admin.lnk"
WScript.Sleep 20000
shell.Open
"\\leeds.smoothwall.net\DFS\homefolder\steve.newton\Documents\Local
Automation scripts\VBS files\Paths\IE11 - Win10.lnk"
WScript.Sleep 20000
Set shell = wscript.CreateObject("Shell.Application")
set x = CreateObject("Wscript.shell")
x.sendkeys("^%{f}")
WScript.Sleep 2000
MsgBox "Automation Startup complete"发布于 2018-03-16 17:30:51
我找到了解决方案,当虚拟机启动时,它们会自动将用户控件发送到活动窗口,我关闭了此选项,现在脚本可以完美地工作。
https://stackoverflow.com/questions/49276682
复制相似问题