Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
bat files that delete folders on C:
Name: ed123456789 Date: August 30, 2004 at 05:18:47 Pacific OS: xp CPU/Ram: p4/512
Comment:
how to create a bat files that delets folders on c drive path is c:\program files\.....
Name: rayok Date: August 30, 2004 at 06:20:46 Pacific
Reply:
in notepad write the following
deltree "C:\Program Files\*"
save it as ooops.bat or similar
deltree deletes folders, del deletes files, you have to put the path into speech marks as it does not follow dos conventions. * is a wildcard - it means anything. the wildcard for files is *.*
errr how are you going to test it ?
Techy n Welsh
0
Response Number 2
Name: johnr Date: August 30, 2004 at 06:24:08 Pacific
Reply:
Here's a good page for teaching you the basics of batch files -
http://www.computerhope.com/batch.htm
beware how you use them to start deleting though, you don't get the usual 'are you sure?' prompts unless you put them in yourself.
"I know that I'm mad - I've always been mad..."
0
Response Number 3
Name: johnr Date: August 30, 2004 at 06:30:08 Pacific
Reply:
By the way, the 'deltree' command doesn't, as far as I know, work under XP, you have to use 'rd' or 'rmdir'.
"I know that I'm mad - I've always been mad..."
0
Response Number 4
Name: rayok Date: August 30, 2004 at 11:33:02 Pacific
Summary: Trying to modify a bat file to delete an existing directory and its contents - then recreate the directory and perform a back up. The latter part works, but now that the directory exists, subsequent b...
Summary: I thought I did a clean install? But my Partition D shows up as a folder on C drive, I have 1 Drive Partitioned into 2,1 Primary and 1 Logical, have not put anything on it yet but there are some folde...