vbs启动应用,执行热键

不完美

WshShell.Run "Postman" '启动 Postman

' 判断标题为 Postman 的窗口是否已经激活
While WshShell.AppActivate("Postman") = false
	wscript.sleep 5000
Wend

暂时没能实现启动 + 执行热键。只好先打开Postman再执行下面

on error resume next
Dim WshShell 
Set WshShell=WScript.CreateObject("WScript.Shell") 
wscript.sleep 1000 * 60 * 60 * 5 ' 5小时后执行 

WshShell.AppActivate "Postman" 
wscript.sleep 3000
WshShell.SendKeys "^~"  ' ctrl + enter

参考资料

MSDN WshShell.SendKeys()

你可能感兴趣的:(VBS)