Monthly Archives: February 2009

vbscript 的 sendKey 举例

‘ 自动到百度搜索歌曲:white flag

Dim WshShell,Path,i

Set WshShell = WScript.CreateObject("WScript.Shell")

WshShell.Run("IEXPLORE.EXE")

WScript.Sleep 2000

WshShell.AppActivate "about:blank-Microsoft Internet Explorer"

WshShell.SendKeys "+{TAB}"

WshShell.SendKeys "http://mp3.baidu.com"

WScript.Sleep 800

WshShell.SendKeys "{ENTER}"

WScript.Sleep 3000

WshShell.SendKeys "white flag"

WScript.Sleep 800

WshShell.SendKeys "{ENTER}"

‘本文来自: 脚本之家(www.jb51.net) 详细出处参考:

‘http://www.jb51.net/article/14776.htm