当我运行下面的 VB 脚本时,我得到了预期的输出。
但是,运行了一个新的 winword.exe 进程,我想在脚本结束后将其杀死。
Set Wshshell= CreateObject("Word.Basic")
WshShell.sendkeys"%{prtsc}"
WScript.Sleep 1500
Set wshshell = Nothing
set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "mspaint"
WScript.Sleep 1000
Set wshshell = Nothing
Set Wshshell= CreateObject("Word.Basic")
WshShell.AppActivate "Paint"
WScript.Sleep 2000
WshShell.sendkeys"^(v)"
WScript.Sleep 1000
WshShell.sendkeys"^(s)"
WScript.Sleep 1500
WshShell.sendkeys"c:\testing.jpg"
WScript.Sleep 500
WshShell.sendkeys "{Enter}"
Set wshshell = Nothing