Windows 7 Forums


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

09 May 2012   #1

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

Windows 7 Ultimate x64 Service Pack 1
Doncaster, UK
 
 

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

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 problems?



Thread Tools



Similar help and support threads for: Deleting a directory structure without deleting the name of the root
Thread Forum
Solved Need to return to the default Windows 7 directory structure General Discussion
Solved Deleting Former RAID Structure on HDD Hardware & Devices
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


All times are GMT -5. The time now is 11:11 AM.


Seven Forums Android App Seven Forums IOS App Follow us on Facebook

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
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32