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-06-22 15:22
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » How to solve annoying problems with clever small DOS commands?! (DOS Expert Small Exam Question) View 5,795 Replies 36
Floor 31 Posted 2004-11-15 00:00 ·  中国 山西 运城 中移铁通
银牌会员
★★★
天的白色影子
Credits 2,343
Posts 636
Joined 2004-03-06 00:00
22-year member
UID 19350
Gender Male
Status Offline
GOTOmsdos, can you dir all the files? Just dir one file or folder is okay. Could it be that an extraction at once goes wrong to two places? Besides, programs always have things not considered. Execute it at once without any prompt. In case of an error, who will be responsible for the loss?
Floor 32 Posted 2004-11-15 00:00 ·  中国 广东 广州 教育网
铂金会员
★★★★
C++启程者
Credits 5,154
Posts 1,827
Joined 2003-07-18 00:00
22-year member
UID 7105
Gender Male
Status Offline
to qzwqzw: You still haven't understood the situation of my question.. Can you read the question meaning and requirements clearly and then express your opinion??
Floor 33 Posted 2004-11-15 00:00 ·  中国 浙江 温州 电信
初级用户
Credits 165
Posts 27
Joined 2004-11-11 00:00
21-year member
UID 33555
Gender Male
Status Offline
Here is the speech by GOTOmsdos on November 8, 2004 at 12:59:27:

CLIMBING, no problem, once a word is spoken, it's hard to take it back. You have to be responsible for your words. DOS is not as bad as you said..
I'll tell you the answer: (switch the directory to D:\PROGRAM), this is exactly the situation I encountered myself.
D:\PROGRAM>for %1 in (*) do del c:\%1
If you don't know where it was extracted to on the C drive, you can add /s, as follows:
D:\PROGRAM>for %1 in (*) do del c:\%1 /s
If the extracted files have both files and subdirectories, please use your brain a bit more..


There is a loophole. Suppose I originally have a file called 1.txt in both f:\program and c:\, but the contents are different. If you execute this, won't my c:\1.txt be deleted too!!! Don't say there's no such coincidental thing, there must be the same situation. Especially you said it extends to subdirectories...
Floor 34 Posted 2004-11-15 00:00 ·  中国 广东 广州 教育网
铂金会员
★★★★
C++启程者
Credits 5,154
Posts 1,827
Joined 2003-07-18 00:00
22-year member
UID 7105
Gender Male
Status Offline
Here's the translation:

This is like this. Let's add: To be sure there are no other important files with the same name elsewhere. If you have many files with the same name, then there's no way, you just have to find and delete them one by one. If you don't want files with the same name anymore, you can use batch processing, have some fun嘛.
Floor 35 Posted 2004-11-16 00:00 ·  中国 浙江 温州 电信
初级用户
Credits 165
Posts 27
Joined 2004-11-11 00:00
21-year member
UID 33555
Gender Male
Status Offline
Well, I've read through and understand what you mean... You've already explained it earlier!!
Floor 36 Posted 2004-11-16 00:00 ·  中国 河北 石家庄 联通
铂金会员
★★★★
网络独行侠
Credits 6,962
Posts 2,753
Joined 2003-04-16 00:00
23-year member
UID 1565
Gender Male
From 河北保定
Status Offline
Hehe, GOTOmsdos is really asking for trouble. It's better to state the premise and conditions of the problem clearly at the top floor, otherwise you'll have to keep explaining.
偶只喜欢回答那些标题和描述都很清晰的帖子!
如想解决问题,请认真学习“这个帖子”和“这个帖子”并努力遵守,如果可能,请告诉更多的人!
Floor 37 Posted 2006-07-15 03:05 ·  中国 江苏 苏州 电信
初级用户
★★
Credits 160
Posts 75
Joined 2006-06-28 01:07
19-year member
UID 57661
Gender Male
Status Offline
Forum Jump: