Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Deleting directories

Status
Not open for further replies.

dljohnson69

IS-IT--Management
Oct 15, 2001
46
US
I am trying to write a simple batch file to remove a directory and everything in it. Since DELTREE is not supported on 2000 what is the easiest way to whack the entire folder?
 
I don't know if it is the same command in 2000, but if you go to a command prompt in XP the command is RMDIR to remove a directory. You could also just type in help at the command prompt and the delete or remove directory command will be listed.
 
RMDIR /?
Removes (deletes) a directory.

RMDIR [/S] [/Q] [drive:]path
RD [/S] [/Q] [drive:]path

/S Removes all directories and files in the specified directory
in addition to the directory itself. Used to remove a directory
tree.

/Q Quiet mode, do not ask if ok to remove a directory tree with /S

-Brett
 
If I am reading this right you also need to delete sub directories under the root directory. In which case RMDIR will not work. If you need to delete all sub directories you will need to write a vbscript/javascript to do it. This can still be run command line. If you need additional help writing the script I can throw something together, or you might search the web for it(I am sure someone has created a script like that).

Hope this helped.

Roger
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top