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-27 00:27
中国DOS联盟论坛 » 其它操作系统综合讨论区 » How to automatically send an Enter key in DOS? View 1,673 Replies 11
Original Poster Posted 2006-06-05 13:46 ·  中国 云南 昆明 联通
初级用户
★★
Credits 182
Posts 88
Joined 2005-11-29 05:52
20-year member
UID 46146
Status Offline
How to send a carriage return in DOS? I use: start d:\the.exe to open the the.exe file and then need to press a carriage return or space. I want DOS to send a carriage return for me.
Floor 2 Posted 2006-06-05 14:29 ·  中国 浙江 宁波 慈溪市 电信
初级用户
Credits 34
Posts 12
Joined 2006-06-04 18:42
20-year member
UID 56544
Status Offline
This depends on whether you need to press OK when directly running the.exe.
If the.exe has command-line parameters, then take a look at its help.
Batch processing itself does not have such a command.
AU3 can do it
Floor 3 Posted 2006-06-05 18:36 ·  中国 上海 黄浦区 电信
金牌会员
★★★★
Credits 4,639
Posts 2,239
Joined 2005-01-30 00:00
21-year member
UID 35785
Gender Male
Status Offline
The keystack command of 4DOS.COM and kstack.com can be used to perform keyboard pre-input.
Floor 4 Posted 2006-06-06 00:47 ·  中国 香港 环球全域电讯
初级用户
★★
Credits 121
Posts 61
Joined 2006-04-18 00:09
20-year member
UID 54007
Gender Male
From HK
Status Offline
How about making a batch file?
echo. > CR
start d:\the.exe < CR 或 type CR|start d:\the.exe
del CR
Floor 5 Posted 2006-06-06 13:09 ·  中国 四川 南充 电信
超级版主
★★★★
我爱DOS
Credits 5,310
Posts 2,044
Joined 2005-09-26 12:00
20-year member
UID 42843
Gender Male
From 四川南充
Status Offline
Floor 6 Posted 2006-06-06 14:22 ·  中国 北京 联通
银牌会员
★★★
DOS联盟捡破烂的
Credits 1,144
Posts 425
Joined 2005-10-20 00:00
20-year member
UID 43784
From 北京
Status Offline
Hey, what people are talking about is pressing Enter. Moderator QUE1234567 pass a Y, heh echo enter>cc start d:\the.exe <cc Try this, if it doesn't work, only use VBS's SENDKEYS to pass it
Floor 7 Posted 2006-06-06 19:37 ·  中国 山西 运城 中移铁通
元老会员
★★★★
Batchinger
Credits 4,432
Posts 1,512
Joined 2002-10-18 00:00
23-year member
UID 19
Gender Male
Status Offline
关于bagpipe:

输入似乎也不只是回车。可以使用echo.向标准字符流发送一个回车符和一个换行符。但通常GUI程序会使用另一套键盘识别机制,而不会接受标准字符流的I/O,所以echo的方法应该无效。所以需要知道the.exe的程序类型。

Regarding bagpipe:

Enter doesn't seem to be just a carriage return. You can use echo. to send a carriage return and a line feed to the standard character stream. But usually GUI programs use another set of keyboard recognition mechanisms and won't accept I/O of the standard character stream, so the echo method should be ineffective. So we need to know the program type of the.exe.
※ Batchinger 致 Bat Fans:请访问 批处理编程的异类 ,欢迎交流与共享批处理编程心得!
Floor 8 Posted 2006-06-06 23:00 ·  中国 云南 昆明 电信
初级用户
★★
Credits 182
Posts 88
Joined 2005-11-29 05:52
20-year member
UID 46146
Status Offline
Can you give an example of the two you mentioned? I haven't used these two things and don't know how to start.
Floor 9 Posted 2006-06-06 23:02 ·  中国 云南 昆明 电信
初级用户
★★
Credits 182
Posts 88
Joined 2005-11-29 05:52
20-year member
UID 46146
Status Offline
Can you give an example? Thanks a lot!
Floor 10 Posted 2006-06-06 23:09 ·  中国 云南 昆明 电信
初级用户
★★
Credits 182
Posts 88
Joined 2005-11-29 05:52
20-year member
UID 46146
Status Offline
Use VBS's SENDKEYS to pass?
How to use it, sending Enter is very important to me. If using other software to do it is a bit not worth it, batch processing is the best here, but there has never been such a thing, please help me, great experts
Floor 11 Posted 2007-01-31 03:42 ·  中国 北京 中国科学院研究生院
银牌会员
★★★
Credits 1,187
Posts 555
Joined 2006-12-21 07:35
19-year member
UID 74129
Gender Male
Status Offline
I made an enter.com file. Just added it to your file. Not sure if it meets your meaning!?

http://www.cn-dos.net/forum/viewthread.php?tid=26456&fpage=1&highlight=enter.com


[ Last edited by scriptor on 2007-1-30 at 02:43 PM ]
Floor 12 Posted 2007-02-01 02:17 ·  中国 广东 潮州 电信
中级用户
★★
Credits 240
Posts 53
Joined 2005-01-21 00:00
21-year member
UID 35493
Gender Male
Status Offline
Pressing Enter can transmit like this

echo.|start d:\the.exe
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
zhclvip +2 2007-02-02 09:12
Forum Jump: