Connecting Tech Pros Worldwide Forums | Help | Site Map

Remove Folder Structure - Dos XP

Member
 
Join Date: Oct 2007
Location: Canada
Posts: 37
#1: Oct 23 '08
What is the correct syntax in a batch file to remove a directory and it's contents recursively?

Thank you

debasisdas's Avatar
Moderator
 
Join Date: Dec 2006
Location: Bangalore ,India
Posts: 7,509
#2: Oct 24 '08

re: Remove Folder Structure - Dos XP


question moved to Windows forum.
DonRayner's Avatar
Expert
 
Join Date: Sep 2008
Location: Canada
Posts: 494
#3: Oct 24 '08

re: Remove Folder Structure - Dos XP


Quote:

Originally Posted by keydrive

What is the correct syntax in a batch file to remove a directory and it's contents recursively?

Thank you

rd c:\....DirectoryName /S /Q

/S = Remove directory and all it's subdirectories / files
/Q = Quiet mode (no questions)
NeoPa's Avatar
Administrator
 
Join Date: Oct 2006
Location: London - UK
Posts: 15,730
#4: Oct 25 '08

re: Remove Folder Structure - Dos XP


As Don says RD or RemDir is the command to use.

I would (nearly) always recommend using CMD files rather than BAT files nowadays (since the early to mid noughties actually) though. Since the demise of Windows 98 (ignoring ME) all Windows based operating systems have been versions of Win NT, and so run the CMD.Exe command interpreter as well as the much more limited Command.Com version (compatible with all older versions of Windows as well as DOS).
Member
 
Join Date: Oct 2007
Location: Canada
Posts: 37
#5: Oct 27 '08

re: Remove Folder Structure - Dos XP


Interesting NeoPa!

Thanks
NeoPa's Avatar
Administrator
 
Join Date: Oct 2006
Location: London - UK
Posts: 15,730
#6: Oct 27 '08

re: Remove Folder Structure - Dos XP


A pleasure :)

Welcome to Bytes!
Member
 
Join Date: Oct 2007
Location: Canada
Posts: 37
#7: Oct 27 '08

re: Remove Folder Structure - Dos XP


Quote:

Originally Posted by DonRayner

rd c:\....DirectoryName /S /Q

/S = Remove directory and all it's subdirectories / files
/Q = Quiet mode (no questions)

Yes that works.

Thanks you DonRayner!
DonRayner's Avatar
Expert
 
Join Date: Sep 2008
Location: Canada
Posts: 494
#8: Oct 27 '08

re: Remove Folder Structure - Dos XP


Quote:

Originally Posted by keydrive

Yes that works.

Thanks you DonRayner!

You're very welcome.
Reply