Saturday, June 12, 2010

How to Delete Folder Contents While Maintaining Folder Tree Structure in Windows

Tips of How to Delete Folder Contents While Maintaining Folder Tree Structure in Windows XP PC » My Digital Life: "Have you came across a scenario whereby you want to delete all files in main and sub folders while maintaining folder tree structure?"

Simple Regedit hack!

cmd /c “echo BE CAREFUL – X out of the window if you don’t want to delete directory contents && pause && echo LAST WARNING – all files and subdirectories will be deleted && pause && cd /d %1 && del /s /f /q *.* && for /f “usebackq delims=” %%d in (`”dir /ad/b/s | sort /R”`) do rd “%%d”"

No comments: