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 07:34
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » How to set the default Enter command View 1,674 Replies 6
Original Poster Posted 2008-05-19 10:50 ·  中国 浙江 绍兴 电信
初级用户
Credits 32
Posts 11
Joined 2008-04-26 10:03
18-year member
UID 116989
Gender Male
Status Offline
Usually it's /y
But it's not suitable for the situation I'm encountering now
I run a program under DOS
And it appears
date : 20071201 》Need to press Enter here
(Y/N):N 》Need to press Y here
How to use batch processing to default these two steps
Floor 2 Posted 2008-05-19 11:05 ·  中国 江苏 苏州 吴江区 电信
银牌会员
★★★
Credits 1,608
Posts 780
Joined 2007-10-07 10:19
18-year member
UID 99089
Gender Male
Status Offline
echo 2008-05-19 |date
Floor 3 Posted 2008-05-19 11:23 ·  中国 浙江 绍兴 电信
初级用户
Credits 32
Posts 11
Joined 2008-04-26 10:03
18-year member
UID 116989
Gender Male
Status Offline
What I mean is: run 12.exe. There appears date:20080519 (default is the current date). After pressing Enter, there appears (Y/N): N (default is N). After pressing Y, continue to run the second half of this program. Now I omit these two steps of pressing Enter and Y, and use a batch file to complete it.

[ Last edited by tagaye on 2008-5-19 at 11:24 AM ]
Floor 4 Posted 2008-05-19 11:31 ·  中国 江苏 苏州 吴江区 电信
银牌会员
★★★
Credits 1,608
Posts 780
Joined 2007-10-07 10:19
18-year member
UID 99089
Gender Male
Status Offline
I don't know if the problem occurs after running the 12.exe program. Then it's a problem with the program.
Floor 5 Posted 2008-05-19 12:09 ·  中国 浙江 绍兴 电信
初级用户
Credits 32
Posts 11
Joined 2008-04-26 10:03
18-year member
UID 116989
Gender Male
Status Offline
This is like this. After running 12.exe, there will be date:20080519. Press Enter or input a new date and then press Enter. Then Y/N. Press Y to continue running the second half of the program, and N to interrupt. The above two steps are both necessary settings after running the program. Generally speaking, I don't need to reset the date. The default date is okay, and there won't be a need to interrupt. Now I just want to make a batch processing to default these two steps. How should I do it? The situation is relatively similar to, for example, the copy command. If there is an existing file with the same name, the /y parameter can be used to complete it. Thanks, I'm very grateful.
Floor 6 Posted 2008-05-19 12:10 ·  中国 上海 联通
版主
★★★★★
Credits 9,023
Posts 5,017
Joined 2007-05-31 19:39
19-year member
UID 89899
Gender Male
Status Offline
echo 2008-05-19 | 12.exe

Also, whether it supports the /y switch depends on your 12.exe
Floor 7 Posted 2008-07-30 16:55 ·  中国 江西 赣州 移动
新手上路
Credits 4
Posts 2
Joined 2008-07-30 16:28
18-year member
UID 122402
Gender Male
Status Offline
Adding "echo y|" in front should work.
Forum Jump: