代码
Dim wshshell
set wshshell = createobject("wscript.shell")
wshshell.run "notepad"
wscript.sleep 1500
wshshell.appactivate "成功"
wshshell.sendkeys "happy birthday!!!"
wscript.sleep 500
wshshell.sendkeys "%FS"
wscript.sleep 500
wshshell.sendkeys " birth.txt" '这里一定要先空一个格,因为系统默认会吃掉第一个字符
wscript.sleep 500
wshshell.sendkeys "%s"
wscript.sleep 500
wshshell.sendkeys "%FX"
sendkeys都是模拟了键盘的操作
因为传输字符需要时间,所以需要sleep一下