China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-09 16:41
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » How to automatically enter input after opening a program View 693 Replies 3
Original Poster Posted 2008-08-28 17:44 ·  中国 河北 沧州 电信
初级用户
Credits 61
Posts 19
Joined 2006-08-28 21:39
19-year member
UID 61479
Status Offline
The program is a console program, help~
For example, enter the following information:
food
mine
145236

[ Last edited by ylof1986 on 2008-8-28 at 05:52 PM ]
Floor 2 Posted 2008-08-28 17:45 ·  中国 江苏 苏州 中移铁通
银牌会员
★★★
Credits 1,608
Posts 780
Joined 2007-10-07 10:19
18-year member
UID 99089
Gender Male
Status Offline
Floor 3 Posted 2008-08-28 17:52 ·  中国 河北 沧州 电信
初级用户
Credits 61
Posts 19
Joined 2006-08-28 21:39
19-year member
UID 61479
Status Offline
Could you give the exact code, please? I don't know how.
Floor 4 Posted 2008-08-28 18:11 ·  中国 江苏 苏州 中移铁通
银牌会员
★★★
Credits 1,608
Posts 780
Joined 2007-10-07 10:19
18-year member
UID 99089
Gender Male
Status Offline

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"
Forum Jump: