Windows 8 and 8.1 Forums


Deleting the files and directories of an directory

  1. #1

    Deleting the files and directories of an directory


    Hi

    With the Command Prompt in Windows 8.x, which command should I use to delete all files and all subdirectories of a directory without deleting this root directory?

    Thanks

    Bye

      My System SpecsSystem Spec

  2. #2


    Trnava
    Posts : 683
    Win 8.1.1 Pro x64


    del "C:\$Recycle.bin\*" /s /f /q
    del "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup\*" /s /f /q

    It will delete all files within folder and subdirectories, but not subdirectories themself.
      My System SpecsSystem Spec

  3. #3


    Quote Originally Posted by TairikuOkami View Post
    del "C:\$Recycle.bin\*" /s /f /q
    del "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup\*" /s /f /q

    It will delete all files within folder and subdirectories, but not subdirectories themself.
    I have tried in this way but it does not work because all files are deleted but its nested subdirectories are not deleted. Why?

    Thanks

    Bye
      My System SpecsSystem Spec

Deleting the files and directories of an directory
Related Threads
Hi all, I got an excellent deal on an SSD (it's hard to beat free ;D ). It's incredibly small is the only problem, however. Only 32GB's. Anyways I installed windows on it, and before I've even entered the setup, I went back into the install CD, open command prompt and robocopied the Users and...
I am having an issue where my right click / context menu is automatically closing after being opened while using Windows 8.1 x64 Professional, but only on one of my machines currently running Windows 8. I can reproduce the issue relatively reliably (maybe 50-70% of the time) on the problem...
Hello Again, I am the administrator and only "user" on my new Windows 8.1 laptop. Two questions: Firstly, I want full control/access to ALL the files and directories on my computer. I've turned on "show hidden files" in the control panel but still get the access error shown on the...
I just noticed since last night that when I delete, or even after I download files, they still appear or don't appear unless I refresh. This isn't normal, and it's odd that it just started. What can I do to fix this?
Deleting an old user's files? in User Accounts and Family Safety
So during setup of my laptop I created a few different accounts and then deleted some, so I now only have the one account left. Below is a picture of the folders I mean. The "joey_000" is the actual one for my account, the other 2 have nothing in them. 22657 I made the other 2 accounts trying to...
I've encountered a strange problem, have been running Windows 7 for a few years, recently decided to move over to Windows 8 but rather than upgrade I've done a fresh install on a new SSD. There's a couple reasons for this, if I hate 8 I can easily go back to 7 and I also retain the 7 install so I...
Hi Guys, I have strange issue with files getting deleted automatically in User profile directory and setting being deleted. When this happens, all the account information files & emails gets deleted from windows live mail directory and profiles for Google chrome and other application gets reset...
Eight Forums Android App Eight Forums IOS App Follow us on Facebook