中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-17 23:47
47,814 topics / 349,907 posts / today 4 new / 48,259 members
DOS疑难解答 & 问题讨论 (解答室) » How do batch commands handle Enter?
Printable Version  877 / 3
Floor1 beer Posted 2006-03-14 18:46
新手上路 Posts 1 Credits 6
For example, after I run a command, the program asks for a response, and I want to just press Enter directly. How do I handle that in a batch file?
Floor2 Michael Posted 2006-03-14 19:53
钻石会员 Posts 3,041 Credits 10,056
echo and the pipe operator should be able to solve it
Floor3 JonePeng Posted 2006-03-14 19:55
金牌会员 Posts 1,883 Credits 4,562 From 广东广州
Assuming the command you mean is program, in a batch file you can use the ECHO. pipe operation, or use the third-party tool KPUSH to send the Enter key's keyboard code (13) into the keyboard buffer, for example:

...
echo.|program
...

or

...
kpush 13
program
...

[ Last edited by JonePeng on 2006-3-14 at 19:58 ]
Floor4 samichang Posted 2006-03-17 09:25
初级用户 Posts 18 Credits 64
echo.|time is for handling the Enter action after the TIME command~~
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023