![]() |
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-26 16:09 |
47,812 topics / 349,910 posts / today 0 new / 48,264 members |
| 其它操作系统综合讨论区 » Delete empty folders |
| Printable Version 2,297 / 4 |
| Floor1 zhaodaijun | Posted 2009-01-24 21:10 |
| 初级用户 Posts 8 Credits 23 From 四川 | |
|
I'm a newbie, and I'd like to ask all you veterans for some advice. I do maintenance work, and because of the viruses on the company computers, I want to delete all files under d:\downloads\
My batch file is written like this: del d:\Downloads\*.* /s /f /q Next I want to delete all the empty folders under downloads\ How should I write it? I'd like to ask you all. Thanks. |
|
| Floor2 gmy | Posted 2009-01-25 00:59 |
| 版主 Posts 392 Credits 1,113 | |
|
About deletion under CMD, what you really should pay attention to is,
1, there is no DELTREE command anymore, so you need to use DEL together with RD. 2, you need to check whether the directory exists before executing, to avoid deleting the wrong thing 3, you can't delete a non-current directory, for example RD D:\ABC\EFG, this works in pure DOS and 98, but not in 2000/XP, you have to CD D:\ABC first and then delete EFG under the current directory. [ Last edited by gmy on 2009-1-25 at 01:02 ] |
|
| Floor3 lianjiang2004 | Posted 2009-01-25 10:46 |
| 金牌会员 Posts 1,884 Credits 3,946 | |
|
The third point is inaccurate. Under XP I haven't found any problem at all deleting a directory on a non-current drive.
|
|
| Floor4 HAT | Posted 2009-02-03 05:58 |
| 版主 Posts 5,017 Credits 9,023 | |
|
rd /s /q
Delete the folder and the files together. |
|
| Floor5 7testing | Posted 2010-06-22 16:27 |
| 新手上路 Posts 17 Credits 16 | |
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |