Computing.Net > Forums > Windows XP > Delete subfolders in batch file

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.

Delete subfolders in batch file

Reply to Message Icon

Name: cweatherford
Date: June 4, 2005 at 09:28:18 Pacific
OS: Windows XP SP1
CPU/Ram: N/A
Comment:

Hey, I think this one should be easier than it is. I want to create a batch file that users can launch from any computer (winxp or win2k) to delete all the subfolders in a network directory. I have an X: drive mapped to a shared folder on every computer and there is a Request folder inside of this. I would like to be able to delete all the subfolders and files out of Z:\Request without deleting the request folder itself. I tried to run the following:
del z:\request\*.* /s /q
rd z:\request /s
but this deletes the request folder too. The users do not have permission to recreate the request folder on the root of the Z: drive.

Anyone want to set me staight on this?

Thanks a bunch,
Chris



Sponsored Link
Ads by Google

Response Number 1
Name: cweatherford
Date: June 4, 2005 at 09:29:39 Pacific
Reply:

The network drive is the Z: drive. Sorry for the comfusion.


0

Response Number 2
Name: Dirty_Sanchez
Date: June 4, 2005 at 10:39:00 Pacific
Reply:

not sure why it isnt working but, you could add a line to add the root folder back if you cannot get it to stop.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Windows XP Forum Home


Sponsored links

Ads by Google


Results for: Delete subfolders in batch file

difference b/w %%g and %g% in batch file www.computing.net/answers/windows-xp/difference-bw-g-and-g-in-batch-file/176113.html

Help in BATCH file www.computing.net/answers/windows-xp/help-in-batch-file/176561.html

BATCH FILES IN XP? www.computing.net/answers/windows-xp/batch-files-in-xp/8304.html