VBscript 中调用wshShell.run 来执行批处理命令 type I love you on a notepad

' type I love you on a notepad
Dim wsh,note
set wsh=CreateObject("WScript.Shell")
wsh.Run "notepad"
WScript.Sleep 400
wsh.SendKeys "I "        '模拟从键盘敲击按键的工程
WScript.Sleep 400        ' 缓慢打字
wsh.SendKeys " L"
WScript.Sleep 400
wsh.SendKeys "O"
WScript.Sleep 400
wsh.SendKeys "V"
WScript.Sleep 400
wsh.SendKeys "E "
WScript.Sleep 400
wsh.SendKeys " Y"
WScript.Sleep 400
wsh.SendKeys "O"
WScript.Sleep 400
wsh.SendKeys "U "

你可能感兴趣的:(VBScript,批处理)