中国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-10 13:04
47,811 topics / 349,897 posts / today 0 new / 48,255 members
DOS批处理 & 脚本技术(批处理室) » [fixed] Code for traversing the whole drive to delete folders won't work
Printable Version  690 / 4
Floor1 5872169 Posted 2008-11-17 09:31
高级用户 Posts 474 Credits 959
It can only delete the 123456 folders inside subdirectories. If I create a 123456 folder in the root directory, it can't delete it. Please take a look at where my code is wrong.



[ Last edited by HAT on 2008-11-17 at 11:14 ]
Floor2 tireless Posted 2008-11-17 10:16
银牌会员 Posts 1,122 Credits 2,025
It really is like that. For example, if the folder C:\123456 exists, then dir /s /a:d /b C:\123456 starts looking for the 123456 folder under C:\123456\.

What I usually do is first check (if exist) whether there is such a file (folder) in the root directory...
Floor3 5872169 Posted 2008-11-17 10:36
高级用户 Posts 474 Credits 959
Thanks to the friend in the post above.
Floor4 moniuming Posted 2008-11-17 10:39
银牌会员 Posts 574 Credits 1,335 From 广西
Try this?
Floor5 5872169 Posted 2008-11-17 10:48
高级用户 Posts 474 Credits 959
moniuming, thank you very much, the test succeeded!!
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023