You can easily delete a folder on Windows by selecting it and pressing the Del key or by right-clicking the folder and selecting Delete. If you don’t want your deleted folder to stay in the Recycle bin for 30 days, you can also press Shift + Del key to permanently delete the folder.
However, sometimes you won’t be able to delete a folder by conventional means, and it can show errors like “folder in use,” or “You’ll require admin permission…” In such cases, you will need to force delete the folder using Command-line-interfaces or through a variety of other ways.
Table of Contents
Using Command Prompt
You can pretty easily force delete a folder by running the
rd /s /q command on the Command prompt. The
/q parameters will forcefully delete the intended folder and all of its subfolders without a confirmation prompt.
- Press Windows + R hotkey to open the Run dialog box.
cmdand press Ctrl + Shift + Enter to open Elevated Command Prompt.
- Now, enter the command
rd /s /q “folder location”. For example,
rd /s /q “C:\Windows Backup\Old Backups"will delete the Old Backups folder.
- If you don’t know how to find the location of a folder, you can right-click the folder on File Explorer and select Copy as path.
If you can’t delete a folder because it says “could not find this item…,” it is likely that the folder or one of its subfolders contains invalid trailing characters. In such cases, you can add the
\\?\ syntax to the full path in the command.
This will use the long device path of the folder and force delete it.
rd /s /q “\\?\C:\Windows Backup\Old Backups "
You can also force delete a folder from the PowerShell command-line interface. It is pretty similar to using Command Prompt, and you’ll be using the
remove-item cmdlet with the
-recurse parameter deletes a folder without prompt confirmation, and the
-force parameter will forcefully delete the folder.
- Open Run Utility by pressing Windows + R shortcut key.
powershelland Ctrl + Shift + Enter to open PowerShell with admin access.
- Enter the command
remove-item -recurse -force “folder location”
Take Ownership of the Folder
Sometimes, even with administrator access, you might not be able to delete a folder. This usually happens when the folder is not owned by you—the system admin. Most of the time, they are the system folders.
However, as the system administrator, you can forcefully take ownership of that folder. Then, you can simply delete the folder.
- Make sure you are logged into Windows with an admin account.
- Right-click on the folder and select Properties.
- Select the Security tab and click on Advanced.
- Next to Owner, click on Change.
- In the text field, enter your currently logged-in account username and click on Check Names.
- If the username entered was valid, it will automatically change to your device name and user name.
- Click OK and OK again.
- Click on Edit and select Users(DeviceName\Users).
- Next to Full control, make sure Allow is selected.
- Click OK and OK again.
- Now, you can delete the folder normally.
Delete Folders in Safe Mode
You won’t be able to delete a folder by conventional means if the folder is in use by an application or service. You can look for which application is using that folder, and end its process from Task Manager. Then, you will be able to delete it.
However, if you can’t find which application is using the folder, you might want to boot into Safe mode. This ensures Windows boots in a basic state with no unnecessary applications and services running. Anyway, let’s see how you can do so:
- Go to the start button and click on the power button icon.
- Hold down the shift key and click on Restart to enter Windows Recovery Environment (WinRE).
- Go to Troubleshoot > Advanced options > Startup Settings and click on Restart.
- After the restart completes, press F4 or 4 to boot into safe mode.
- Now, you can use conventional methods to delete the intended folder.
Using Third-Party Software
Lastly, you can use third-party software to forcefully delete folders on Windows. There are some great applications that perform this function like Unlocker, File Assassin, and XL Delete. While you will need to download and install them, these applications make it way simpler to force delete a folder after installation.