Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Deleting a directory structure without deleting the name of the root


09 May 2012   #1
balubeto

Windows 7
 
 
Deleting a directory structure without deleting the name of the root

HI

With the command prompt of Windows 7 SP1, how do I delete a directory structure with their files without deleting the name of the root directory?

THANKS

BYE


My System SpecsSystem Spec
09 May 2012   #2
Dwarf

Windows 8.1 Pro RTM x64
 
 

So you want to delete the contents of a folder without deleting the folder itself? Would that also include sub-folders within that folder?

Simply enter cd <path to directory> at the prompt to make the required directory the target of the next command. Then, after verification that this is the correct directory and that you do indeed want to remove its contents, enter del *.* at the prompt. This should delete its contents, but not the directory itself. Please note that content cannot be easily recovered, which is why I asked you to verify the location first.
My System SpecsSystem Spec
09 May 2012   #3
edwar

7 x64
 
 

Open Win Explorer, highlight the directory in the left hand side, Which will display all sub-folder and files on the right hand side, select all on the right, Press the Delete Key.

Why fool with the CMD Prompt when it is so easily done in Explorer.
My System SpecsSystem Spec
Reply

 Deleting a directory structure without deleting the name of the root




Thread Tools



Similar help and support threads for2: Deleting a directory structure without deleting the name of the root
Thread Forum
Solved Deleting Former RAID Structure on HDD Hardware & Devices
Solved Robocopy /MOV command copying but not deleting from source directory General Discussion
Solved Robocopy? Copy Directory Structure 1 level General Discussion
Solved Need to return to the default Windows 7 directory structure General Discussion
Media players and directory structure Music, Pictures & Video
Recover Files after deleting partition with folder structure? General Discussion
Deleting a playlist without deleting the WMP database Sound & Audio

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 02:30 PM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App