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-07-01 09:03
中国DOS联盟论坛 » DOS疑难解答 & 问题讨论 (解答室) » How to make the default input for xcopy c:\txt d:\txt /d /u /p be N View 939 Replies 4
Original Poster Posted 2007-03-21 00:51 ·  中国 辽宁 沈阳 电信
新手上路
Credits 8
Posts 3
Joined 2007-03-19 23:44
19-year member
UID 82275
Gender Male
Status Offline
I tried echo N|xcopy c:\txt d:\txt /d /u /p

But the result shown was as follows:

C:\Documents and Settings\Dell>echo N|xcopy c:\txt d:\txt /d /u /p
C:\txt\1.txt (Y/N)? N
C:\txt\15204.txt (Y/N)?
C:\txt\15204.txt (Y/N)?

C:\txt\15204.txt (Y/N)?

C:\txt\15204.txt (Y/N)? C:\txt\21195.txt (Y/N)? 0 File(s) copied

Why did it turn out like this?
Floor 2 Posted 2007-03-22 02:20 ·  中国 山东 济南 移动
钻石会员
★★★★★
Credits 10,046
Posts 3,039
Joined 2002-11-11 00:00
23-year member
UID 223
Gender Male
Status Offline
Because what echo N sends is not just the keyboard scan code for N.
You can solve it with for ......... exist................, or write a binary file whose contents are all 4e, then use < to redirect it to xcopy's input.
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
windbamboo +1 2007-03-23 00:51
简单就是美
Floor 3 Posted 2007-03-23 00:51 ·  中国 辽宁 沈阳 电信
新手上路
Credits 8
Posts 3
Joined 2007-03-19 23:44
19-year member
UID 82275
Gender Male
Status Offline
Thanks to Michael for the helpful explanation, I basically understand the reason now, and I'm currently thinking of a way to solve it. Thanks again!
Floor 4 Posted 2007-03-23 14:32 ·  加拿大 Bell
系统支持
★★★★★★
“新DOS时代”站长
Credits 27,736
Posts 10,521
Joined 2002-10-09 12:00
23-year member
UID 9
Status Offline
You can have a look here. I've already proposed adding an /I switch to the CP command, to automatically answer "No", that is, skip files that already exist:

http://www.cn-dos.net/forum/viewthread.php?tid=28739&fpage=1
Wengier - 新DOS时代

欢迎大家来到我的“新DOS时代”网站,里面有各类DOS软件和资料,地址:
http://wendos.mycool.net/

E-Mail & MSN: wengierwu AT hotmail.com (最近比较忙,有事请联系DOSroot和雨露,谢谢!)

Floor 5 Posted 2007-04-21 07:10 ·  中国 湖南 湘潭 电信
新手上路
Credits 18
Posts 9
Joined 2007-04-15 01:58
19-year member
UID 85199
Gender Male
Status Offline
How do I suppress the [y|n] in the sc command?
Forum Jump: