中国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-09 08:30
47,811 topics / 349,895 posts / today 0 new / 48,253 members
DOS批处理 & 脚本技术(批处理室) » How to set the default Enter command
Printable Version  1,676 / 6
Floor1 tagaye Posted 2008-05-19 10:50
初级用户 Posts 11 Credits 32
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
Floor2 huahua0919 Posted 2008-05-19 11:05
银牌会员 Posts 780 Credits 1,608
echo 2008-05-19 |date
Floor3 tagaye Posted 2008-05-19 11:23
初级用户 Posts 11 Credits 32
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 ]
Floor4 huahua0919 Posted 2008-05-19 11:31
银牌会员 Posts 780 Credits 1,608
I don't know if the problem occurs after running the 12.exe program. Then it's a problem with the program.
Floor5 tagaye Posted 2008-05-19 12:09
初级用户 Posts 11 Credits 32
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.
Floor6 HAT Posted 2008-05-19 12:10
版主 Posts 5,017 Credits 9,023
echo 2008-05-19 | 12.exe

Also, whether it supports the /y switch depends on your 12.exe
Floor7 qgscrosswing Posted 2008-07-30 16:55
新手上路 Posts 2 Credits 4
Adding "echo y|" in front should work.
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023