Login | |
|
 |
RE: This should be simple... :) - 6/18/2008 2:01:23 PM
|
|
 |
|
| |
DiGiTAL.SkReAM
Posts: 1184
Score: 7
Joined: 9/6/2005
From: Florida, USA
Status: offline
|
To delete folders AND files, you will need to run two seperate commands: The files are easy: del t:\temp\*.* /q /f For the folders, you have to use the FOR command to iterate through all of the subfolders: for /d %D in (t:\temp\*) do @rd /s /q "%D" Some purists might say that you can use the /s command arg on the del command to delte all files in any subfolders as well, but I have found that using RD to delete subdirs AND their files is actually faster. And remember: if you use the for command at a command prompt, the variable only has one percent sign. INSIDE of a batch file, though, and %D needs to be written as %%D or else it won't work. And if you are using rd, it is ALWAYS best to TEST FIRST AND MAKE BACKUPS!!!!! <-my rear-covering-disclaimer
_____________________________
"Would you like to touch my monkey?" - Dieter (Mike Meyers) "It is better to die like a tiger, than to live like a pussy." -Master Wong, from Balls of Fury
|
|
| |
|
|
|
| |
|
|
 |
|
 |
|
|