Sometimes deleting a folder and it’s contents from Windows Explorer can take an eternity especially when dealing with large folders as it deletes each file one by one. The faster way is to delete the folder from the windows command prompt.
To delete a directory or folder and all it’s contents from the command prompt:
Step 1. Open an Elevated Command Prompt
Windows 7
- Click Start, click All Programs, and then click Accessories.
- Right-click Command prompt, and then click Run as administrator.
- If the User Account Control dialog box appears, confirm that the action it displays is what you want, and then click Continue.
Windows 8 and higher
- Click the Start button .
- In the Search box, type command prompt.
- In the list of results, right-click Command Prompt, and then click Run as administrator.
Step 2. Type in the following command
RD /S /Q "The Full Path of Directory"
Where the full path of the folder is the one which you want to delete. E.g. “c:\data\folder”
Notes
Please be aware that the command to delete a folder on your windows computer is final. The delete items won’t go to the recycle bin first and if you put in the wrong path you could be in trouble. If in doubt, backup first!
Click to rate this post!
[Total: 47 Average: 3]
Hello, recently I made the mistake of copying most of my C drive onto my desktop, long story, at any rateI was able to delete the majority if the folder so its not taking up alot of space, however there is a small portion that remains and so the offending folder stayed,
something about windows needing administrator privileges to delete this folder yada yada, so using the admin credentials i try this, asks for the same thing, so I run Command prompt as an administer and try to run the above command, RD /S /Q C:\Users\Desolator\Desktop\C
and i get a notice “: access is denied.” for each of the remaining folders.
is there a way around this?
Thanks
Run the command prompt as administrator
try launching the cmd with administrator rights.
but I applied the same command in Windows 10, and command prompt show the message that a given directory is not empty.
what should I do please. If you have another procedure in your mind.
Thanks so much! I had a problem where I no longer needed a folder so I tried to delete it, but it wouldn’t let because it said that the files in it were currently being used by another program, but they weren’t; there were no other tabs open. So I tried to go into the CMD and use the command “del (folder name)”, but it still didn’t work, so I needed some way to just force it off of the hard drive regardless of any circumstances, because I have OCD, and the folder really bothered me by it being there, so I found this, tried it out, and it actually worked! Quite honestly, I didn’t think it would. But, it did, so, thanks so much!
Thanks there was a virus installed on a hidden folder where it said there were no folders, so i then went with cmd to the path of the virus and deleted the fiolder it was in, thanks 😉
RD /S /Q — What are the full forms How is it executed?
/S Removes all directories and files in the specified directory
in addition to the directory itself. Used to remove a directory
tree.
/Q Quiet mode, do not ask if ok to remove a directory tree with /S
My user name is THANK YOU and it says invalid switch please correct as this is the code i used to delete a game file
RD /S /Q Local Disk (C:)/Users/THANK YOU/DownloadsSTEM/steamapps/common/Unturned/Bundles/Workshop/Maps/France
ty very much was driving me bonkers, this worked for windows 10
This was incredibly useful for me trying to uninstall Phantasy Star Online 2, which has been infamously problematic with installs and uninstalls since it’s recent US launch on the Windows Store. Thank you!
This is the command that appears to have solved my problems: RD /S /Q “pso2_bin”
Hi
i unable delete the file.im getting below error
C:\Users\Administrator>RD /S /Q D:\NP DATA BACKUP\2016-11\B4\C
The system cannot find the file specified.
The system cannot find the file specified.
The system cannot find the path specified.
Put the file location in quotes.
Command is not working its showing access denied.
How i can delete these file any idea please.
C:\Windows.old\Windows\ShellExperiences\PeopleCommonControls.dll – Access is denied.
C:\Windows.old\Windows\ShellExperiences\PeoplePane.dll – Access is denied.
C:\Windows.old\Windows\ShellExperiences\QuickActions.dll – Access is denied.
C:\Windows.old\Windows\ShellExperiences\QuickConnectUI.dll – Access is denied.
C:\Windows.old\Windows\ShellExperiences\ScreenClipping.dll – Access is denied.
C:\Windows.old\Windows\ShellExperiences\SharePickerUI.dll – Access is denied.
C:\Windows.old\Windows\ShellExperiences\ShoulderTapView.dll – Access is denied.
C:\Windows.old\Windows\ShellExperiences\StartUI.dll – Access is denied.
C:\Windows.old\Windows\ShellExperiences\TileControl.dll – Access is denied.
C:\Windows.old\Windows\ShellExperiences\VirtualTouchpadUI.dll – Access is denied.
C:\Windows.old\Windows\ShellExperiences\Windows.UI.ActionCenter.dll – Access is denied.
C:\Windows.old\Windows\ShellExperiences\Windows.UI.SoftLanding.dll – Access is denied.
C:\Windows.old\Windows\ShellExperiences\WindowsInternal.People.PeoplePicker.dll – Access is denied.
C:\Windows.old\Windows\ShellExperiences\WindowsInternal.People.Relevance.dll – Access is denied.
C:\Windows.old\Windows\ShellExperiences\WindowsInternal.People.Relevance.QueryClient.dll – Access is denied.
C:\Windows.old\Windows\SKB\LanguageModels\lm.en-001.dat – Access is denied.
C:\Windows.old\Windows\SKB\LanguageModels\lm.en-AU.dat – Access is denied.
C:\Windows.old\Windows\SKB\LanguageModels\lm.en-CA.dat – Access is denied.
C:\Windows.old\Windows\SKB\LanguageModels\lm.en-GB.dat – Access is denied.
C:\Windows.old\Windows\SKB\LanguageModels\lm.en-grammar.dat – Access is denied.
C:\Windows.old\Windows\SKB\LanguageModels\lm.en-US.dat – Access is denied.
C:\Windows.old\Windows\SKB\LanguageModels\lm.en.dat – Access is denied.
run cmd as administrator