如何用vbs模拟按键

来源:百度知道 编辑:UC知道 时间:2024/06/04 15:01:28
我使用的迅雷有个老板键:alt + ` (这个是Esc键下面的那个键)
启动迅雷的路径是:D:\Thunder\Thunder.exe

我想在开机时自动一个VBS脚本来启动迅雷,启动迅雷后按下老板键alt + ` 让它隐藏界面,请问如何写这个VBS?

请高手帮忙写一个,满意的分数x2,不胜感激!

Dim objws,sThunderPath
Set objws=WScript.CreateObject("wscript.shell")
sThunderPath="D:\Thunder\Thunder.exe "
objws.Run sThunderPath,True
WScript.Sleep 1000
objws.SendKeys "%`"

你测试一下。因为我没找到老板键在哪里设置,所以没法测试 - -!
呵呵,不对了告诉我。
保存后放到启动里就行了。这个你应该知道吧。我就不说了。

Set ws=CreateObject("wscript.shell")

ws.Run "D:\Thunder\Thunder.exe",true,1

ws.appactivate("迅雷")

ws.SendKeys "%{~}"