DOS command to delete subfolders

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

This is probably a simple question, but does anyone know a DOS command to
completely clear out a folder's contents (including the subfolders
themselves)? With Win 2000, I gave up and deleted the folder and recreated
the folder. However I can't seem to even do that in Windows XP Pro. Prior to
Win 2000 I would have used deltree. Any ideas?

Thanks,
Nick
 
Nick said:
This is probably a simple question, but does anyone know a DOS command to
completely clear out a folder's contents (including the subfolders
themselves)? With Win 2000, I gave up and deleted the folder and recreated
the folder. However I can't seem to even do that in Windows XP Pro. Prior to
Win 2000 I would have used deltree. Any ideas?

Thanks,
Nick

RMDIR /S

steve
 
Nick said:
This is probably a simple question, but does anyone know a DOS command to
completely clear out a folder's contents (including the subfolders
themselves)?

Del has an /S switch to propagate to subdirectories, so
DEL /S Folder\*.*
will delete everything in Folder and its subdirectories
 
This is probably a simple question, but does anyone know a DOS command to
completely clear out a folder's contents (including the subfolders
themselves)?


Del has an /S switch to propagate to subdirectories, so
DEL /S Folder\*.*
will delete everything in Folder and its subdirectories
[/QUOTE]

Using DEL /S d:\temp\*.* will remove all files in d:\temp, but will
leave the subfolders but will delete everything in them. RMDIR will
remove the d:\temp folder and all the subfolders so you have to include
a command to recreate the d:\temp.

It was one of the reasons I copy DELTREE over to most client XP machines.

--
Terry

***Reply Note***
Anti-spam measures are included in my email address.
Delete NOSPAM from the email address after clicking Reply.
 
Thanks to all that answered! rmdir will definitely work!

Terry said:
Del has an /S switch to propagate to subdirectories, so
DEL /S Folder\*.*
will delete everything in Folder and its subdirectories

Using DEL /S d:\temp\*.* will remove all files in d:\temp, but will
leave the subfolders but will delete everything in them. RMDIR will
remove the d:\temp folder and all the subfolders so you have to include
a command to recreate the d:\temp.

It was one of the reasons I copy DELTREE over to most client XP machines.
[/QUOTE]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top