Br4tt3 Posted November 22, 2005 Posted November 22, 2005 lo pepz..I am prolly of the chart on this one, but it is annoying! What I want to do is to the delete everything below a certain directory (for example c:\temp). However, I dont wanna delete the temp dir, just all folders and files below it...If I check the /? for del / erase and rmdir it doesnt really solve it (if I am not mistaken). rmdir /S comes closest but it will also delete the c:\temp which I wanna keep in this cfg. So, can anyone please prove me wrong? Also, I dont wanna right big messy .vbs enumerations and recursively delete all files or folders with diffrent commands.Best RegardsThaSausageEater...
nmX.Memnoch Posted November 22, 2005 Posted November 22, 2005 If you want the directory name to stay the same why not do it this way? It seems the simplest solution to me...DEL C:\TEMP /S /QMD C:\TEMP
cluberti Posted November 22, 2005 Posted November 22, 2005 You could always just copy the deltree.exe from a Win9x CD to the system32 directory on your box. Deltree does work in XP.It is also downloadable from http://www.uv.tietgen.dk/staff/mlha/Download/DOS/ (lots of other DOS goodies there too).
IcemanND Posted November 22, 2005 Posted November 22, 2005 (edited) cd c:\tempdel *.*for /F %%a in ('dir /ad /b') do rd /s /q %%a Edited November 22, 2005 by IcemanND
Br4tt3 Posted November 23, 2005 Author Posted November 23, 2005 cd c:\tempdel *.*for /F %%a in ('dir /ad /b') do rd /s /q %%aThanks guys!I will go with the IcemanND solution. Tried it and it did the work... again, thx!Best RegardsThaSausageEater..
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now