Help with deleting files and folders using a script

By support ·
I have a requirement to delete all files and folders (excluding the files and folders that are in use) from the following locations:

del /s /f /q C:\Temp\*.*
del /s /f /q C:\WINDOWS\Temp\*.*
del /s /f /q "C:\Documents and Settings\%username%\Local Settings\Temp\*.*"
del /s /f /q "C:\Documents and Settings\%username%\Local Settings\Temporary Internet Files\*.*"

My problem is that I can delete all files but not any folders. If I use the ?rmdir? command I believe I need to specify the name of the folders that I wish to delete, but means they are all temp folders that would be impossible.

Ideally I would need a vscript that can do the above or something adding that I have I missed from my script (above)

Hope this makes sense???
Thanks for looking

This conversation is currently closed to new comments.

0 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Share your knowledge
Back to Networks Forum
0 total posts (Page 1 of 1)  

Related Discussions

Related Forums