Board logo

标题: 怎样实现打开程序后自动输入 [打印本页]

作者: ylof1986     时间: 2008-8-28 17:44    标题: 怎样实现打开程序后自动输入

程序是一个控制台程序哦,求救啦
比如输入以下信息:
food
mine
145236

[ Last edited by ylof1986 on 2008-8-28 at 05:52 PM ]
作者: huahua0919     时间: 2008-8-28 17:45
sendkeys
作者: ylof1986     时间: 2008-8-28 17:52
请给出具体的代码好不好啊,我不会啊
作者: huahua0919     时间: 2008-8-28 18:11

set wshshell=wscript.createobject("wscript.shell")
wshshell.run "控制台程序路径"
wscript.sleep 1000
wshshell.sendkeys "food"
wscript.sleep 500
wshshell.sendkeys "~"
wscript.sleep 500
wshshell.sendkeys "mine"
wshshell.sendkeys "~"
wscript.sleep 500
wshshell.sendkyes "145236"