Trying to delete a stubborn file or folder from your Windows PC can be frustrating. For example, you could be pressing delete and thinking the file or folder is gone, only to find it in the exact location you removed it from.
There are several reasons why you can’t delete a file or folder, including:
- The file may be in use by another program, background process, or application.
- The file’s unlock process may not have been completed.
- Disk failure or corruption.
- The folder or file is read-only or corrupted.
- You may be trying to delete a system file.
- The Recycle Bin is either full or corrupted.
- The file or folder is infected with malware or a virus.
- The disk is write-protected or full.
- You get the Access Denied warning when you try deleting files or folders from a mounted external drive.
This guide explains how to force delete a file or folder in Windows 10 and get rid of it for good.
You can force delete a file or folder in Windows via Command Prompt, Safe Mode, using a keyboard shortcut, or using a third-party app. Before trying any of these methods, here are a few basic steps to help you get around the issue:
- Close any running applications or programs on your computer, and then delete the file or folder again.
- Use Task Manager to close the file or folder and then try deleting it again.
- Restart Windows and see if you can delete the file or folder successfully once your computer reboots.
- Run a virus or malware scan to check for threats that may lurk within your PC.
- Check whether the file or drive is marked as read-only, otherwise you may not be able to delete the file or folder. You can do this by right-clicking on the file or folder and selecting Properties.
- Update Windows and then try to delete the problematic file or folder.
If the above basic steps didn’t help resolve the issue, use the methods below to force delete a file or folder in Windows.
Force Delete a File or Folder in Windows Using Command Prompt
Command Prompt in Windows PCs can perform advanced administrative functions, automate tasks via batch files and scripts, and troubleshoot issues in Windows.
How to Force Delete a File Through Command Prompt
- Type CMD in the search box and select Run as administrator.
- Type cd x:\ and press Enter. In this case, x represents the name of the drive letter, where the folder containing the file you want to force delete resides.
- Type del filename and press Enter. Make sure you replace the filename with the name of the file you want to delete in Windows.
Alternatively, type the command as del /F c:\users\thispc\desktop\filename to force delete the file if it is read-only. In this case, you’ll enter del plus your the /F parameter, the file’s location, and the filename, which would look something like this: del /F c:\admin\thispc\desktop\deletethis.
Note: If you use del to delete a file in Windows, you can’t retrieve the file later.
How to Force Delete a Folder Through Command Prompt
If the folder has a file in it, you can use the steps above to force delete the file and then use Command Prompt to delete the folder. This process can be tedious and time-consuming if you have many nested files and folders, but here’s how to do it quickly.
- Open Command Prompt > Run as administrator.
- Use the /s flag with rmdir to force delete the folder along with subfolders and files in it. For example, if you want to remove a folder called “Test Folder”, enter rmdir /s test folder.
- If you get a prompt to confirm the deletion, select Y and press Enter.
Note: Any folder you delete using the rmdir command cannot be retrieved.
Delete a File or Folder in Windows Using Safe Mode
Safe Mode is a diagnostics mode that starts Windows in a basic state with a limited set of drivers and files. You can delete files or folders in Safe Mode, which you’d otherwise not be able to delete before.
Enter Safe Mode, find the file or folder you want to delete, and then reboot your PC to exit Safe Mode.
Use a Third-Party Program to Force Delete a File or Folder in Windows
If you still cannot force delete a file or folder after trying the steps above, you can use a third-party program to simplify the deletion of the files and folders.
Unlocker is one of the best file or folder deletion programs that allows you to regain control over your data by unlocking files and killing unresponsive processes.
The app can kill processes, unload DLLs, unlock, delete, rename or move locked files without restarting your computer and deleting index.dat files. However, Unlocker can kill important processes and delete critical files from Windows, so you need to be cautious when using the app.
Other similar tools that you can use include File Assassin and Long Path Tool.
Remove Stubborn Files and Folders from Your PC
Trying to remove undeletable files and folders from your computer can be stressful. However, with the solutions here, you should get around this problem and delete the files or folders for good.
Let us know what worked for you by leaving a comment in the section below.
Related Posts
- How to Fix a “This file does not have an app associated with it” Error on Windows
- How to Fix an Update Error 0x800705b4 on Windows
- How to Resolve “A JavaScript error occured in the main process” Error on Windows
- How to Fix the Network Discovery Is Turned Off Error on Windows
- How to Change Folder Icons in Windows
“Hello, please help! I tried to delete a folder and it shows I have no permission to do it. How can I force delete such folders or files?”
Generally, we would press the Shift +Delete keys to delete a folder or file. But when you get the error message saying you cannot delete the folder, what can you do? In this article, you can learn effective methods to force delete a folder in Windows 11/10.
- Reasons: Why the folder cannot be deleted
- Method 1: Force Delete a Folder via CMD
- Method 2: Force Delete a Folder with File Deletion Genius
- Method 3: Force Delete a Folder in Safe Mode
- Method 4: Force Delete a Folder by WinRAR
- Method 5: Force Delete a Folder by Replacing the Owner
Reasons: Why the folder cannot be deleted
When you cannot delete a folder on your Windows computer, you can check the following reasons:
- The folder is in use by a program now.
- The folder is read-only.
- The folder is a Windows system folder.
- There is a virus on the folder that prevents you to delete it.
- …
Thus, if you make sure that the folder is useless and make up your mind to remove it from your computer, you can try the following methods.
Method 1: Force Delete a Folder via CMD
It is convenient to force delete a folder via the command prompt no matter it is in use by other programs or not.
Step 1: Run Command Prompt as the administrator.
Step 2: Enter and execute the following commands: rmdir /s /q PATH
Tips: You can right-click the folder and then choose Copy as Path option to get the folder path.
Immediately, the folder is removed from your computer permanently without going to recycle bin.
Method 2: Force Delete a Folder with File Deletion Genius
If you are not good at CMD, there is another easy way to force delete a folder. You can use iSunshare File Deletion Genius to permanently remove files or folders from your computer.
Step 1: Download, install, and launch iSunshare File Deletion Genius on your computer.
Step 2: Drag the folder into the software.
Step 3: Choose the Erase Selection. Always Slow Mode is set by default.
Step 4: Click the Delete button in the bottom right corner.
Step 5: A warning box comes to tell you that the deleted files cannot be recovered in any way. Click on OK to continue.
In no time, the folder is erased from your computer.
This software can also delete your folder or files in bulk. It is much easier for you to perform deletion on stubborn data with this software.
Method 3: Force Delete a Folder in Safe Mode
It is simple to delete a folder in Windows safe mode as many applications will not work.
Step 1: Restart the computer and hold pressing the Shift key.
Step 2: Choose Troubleshoot option.
Step 3: Click Advanced Options to go ahead.
Step 4: Click Startup Settings.
Step 5: Click Restart button instantly. Then wait for minutes for the computer restarts.
Step 6: Press F4, F5 or F6 to enter Windows safe mode.
Then your computer will start in safe mode. You can directly find the folder and then try to delete it.
Method 4: Force Delete a Folder by WinRAR
There is an option in WinRAR—Delete files after archiving. If your folder is undeletable, you can try this method. But you need to download and install WinRAR in your software in advance.
Step 1: Right-click the folder and then choose Add to Archive.
Step 2: On the Archiving options section, you can find Delete Files after archiving option. Go to check this option.
Step 3: Click the OK button on the bottom and then you can get an archive file from your folder.
Yes, your folder is deleted after the RAR file is made. And now, you can easily remove the RAR file from your recycle bin.
Method 5: Force Delete a Folder by Replacing the Owner
If you want to force delete a folder without permission, you can take ownership of the folder and then delete it at last. Let’s go to check how to change the ownership of a folder.
Step 1: Right-click the folder and choose the Properties option.
Step 2: Click the Security tab and then hit on the Advanced button.
Step 3: Click the Change button behind Owner section. Then enter your name into the box and hit on the Check Names button near it.
Then it will load the full location of your name. Click OK to go ahead.
Step 4: Now the owner changes to you and you need to check this option: Replace owner on subcontainers and objects. Then click the Apply and OK button.
Now you can go to delete the folder that asks for permission before.
Related Articles:
- How to Delete File That Another Program is Using
- Fixed—Unable to Delete Files from External Hard Drive
- How to Securely Delete Big Files or Folders in Windows 10
- How to Make a File or Folder Undeletable in Windows 10
Updated on Apr 28, 2025
Sometimes, you may fail to delete files or folders on your Windows computer. In such cases, using the Command Prompt (CMD) can be an effective way to force delete files and folders that can’t be deleted. Additionally, third-party tools like EaseUS Partition Master offer alternative solutions for managing undeletable files. This EaseUS article will provide a step-by-step tutorial on using CMD and other solutions to force delete files and folders.
How to Force Delete Files Using CMD
The Command Prompt is a powerful tool in Windows that allows you to execute commands to perform various tasks, including deleting files and folders. Before processing, you should make sure your file or folder is ready:
- Check no program or application is using the file/folder you want to delete.
- Check if this file is corrupted.
- Ensure this file is not on read-only status.
Now, let’s go through the detailed steps:
Step 1. Press «Windows + R» to open the Run dialog. Type cmd and press Enter to run Command Prompt as an administrator.
Step 2. Right-click the file you want to delete and select «Properties» to find its path. (Or, you can right-click the file and select «Copy as path» to copy the file path directly. )
Step 3. In the Command Prompt, type del followed by the file path. Then, press «Enter» to execute this command.
(for example del c:\users\JohnDoe\Desktop\text.txt).
Alternative Way: Using EaseUS Partition Master
EaseUS Partition Master Professional is a versatile tool that offers a file shredder feature, allowing you to permanently delete files and folders. This method is particularly useful for ensuring that deleted files cannot be recovered.
Step 1. Launch EaseUS File Shreder
Run EaseUS Partition Master, go to the Disovery section, and click «File Shredder» to run this file shreding tool.
Step 2. Select Files or Folders to Shred
Drag files or folders to the center area or click «Add Folder», «Add Files» to select target files or folder to shred.
Step 3. Confirm to Shred
Confirm the selected files or folders, and click «Shred» to execute the operation to permanently shred data from your device.
If you want to learn other available solutions, this guide is what you looking for:
How to Force Delete A File on Windows 11/10/8/7
Your file/folder cannot be deleted? Don’t worry. This post contains multiple solutions, including Command Prompt, Windows Delete short keys, Task Manager, and third-party file deleting tools.
Why Files Can’t Be Deleted?
What are the common reasons files can’t be deleted in Windows? Files in Windows often cannot be deleted due to several common reasons. Here are the typical reasons:
✔️The File Is in Use: A file might be open in a background process or application, even if it’s not visible on the screen. This prevents Windows from deleting the file until the process is closed.
✔️System File Restrictions: Windows protects certain system files from deletion to maintain system stability. Attempting to delete these files will result in an error.
✔️Permissions Issues: You might not have the necessary permissions to delete a file, especially if you’re not logged in as an administrator or if the file’s ACL (Access Control List) restricts access.
✔️File/Folder Corruption: If a file or folder is corrupted, standard deletion methods may fail. Special steps are required to remove corrupted files.
✔️Write-protection or Read-only Status: Files or folders may be set to read-only, either manually or due to disk errors, preventing any modifications, including deletion.
Now, you can share the above solutions and potential reasons with more users:
Conclusion
Force deleting files and folders in Windows can be achieved through various methods, including using the Command Prompt, EaseUS Partition Master, and other Windows solutions. Each method has its advantages and should be chosen based on the specific situation. For instance, CMD is ideal for direct deletion, while EaseUS Partition Master ensures permanent deletion. Always be cautious when deleting files to avoid data loss or system issues.
FAQs: How to Force Delete Files Using CMD in Windows
1. How do I check if my file is corrupted?
To check file corruption: Verify file extension compatibility, try opening with different software, check if the size is 0 bytes, use hash/signature validation, or attempt file read with error handling. System tools like chkdsk can detect disk-related corruption.
2. Can I delete undeletable files in CMD?
Yes, you can delete undeletable files using the Command Prompt (CMD) in Windows. Check part 1 of this article.
3. How do you force delete a file that says access denied?
To resolve this problem, choose one of these options:
#1. In Windows Explorer, select the files/folders you want to remove and press Shift + Delete. This method prevents the items from being stored in the Recycle Bin and deletes them immediately.
#2. Launch the Command Prompt and type the command: rd/s/q»full path of the target file or folder»
Do you want to delete a directory from Windows command prompt(CMD)? This post explains how to use the command rmdir
to delete folders and their contents. You can also find examples for each use case of folder deletion – empty folders, non empty folders, folders with white spaced names etc.
Delete folder from CMD
Run the command rmdir
on the folder.
rmdir directoryname
Example:
C:>rmdir emptydir C:>
How to delete a non empty folder
The simple rmdir
does not work for folders having some content.
C:>rmdir nonemptydir The directory is not empty.
Use /s
option to delete the folder contents along with the folder. This deletes all subfolders recursively.
C:>rmdir /S nonemptydir nonemptydir, Are you sure (Y/N)? y C:>
Force delete a folder without confirmation
To force delete directory, without being asked for confirmation, we can use /Q switch.
rmdir /Q /S nonemptydir
We can also use ‘rd’ in place of ‘rmdir‘. Both names refer to the same command. This command works on Windows 2000, Windows XP, Server 2003, Vista, Windows 7 and 10.
Deleting directory with white spaces in the name
Rmdir
can delete files with whitespaces in the name, you just need to wrap up the folder name in double quotes as shown in the below example.
rmdir /Q /S "folder with spaces in the name"
Delete contents of a directory but keep the directory
The usecase here is to delete all the contents of the directory but keep the parent directory so that we do not need to create it again. rmdir /Q /S
does not work here as it deletes the parent directory too. Rather the below commands should do the trick.
forfiles /P directory_path /M * /C "cmd /c if @isdir==FALSE del @file" forfiles /P directory_path /M * /C "cmd /c if @isdir==TRUE rmdir /S /Q @file"
This works in 2 steps – the first command deletes all files, whereas the second one deletes all subdirectories.
Errors
To delete a directory, you should have appropriate access permissions on the directory. Otherwise rmdir throws ‘Access denied’ error.
Quick Links
-
Why You Can’t Delete a Folder on Windows?
-
Use Command Prompt to Remove Write Protecion
-
Boot Windows into Safe Mode to Delete a Folder
-
Use Third-Party Software to Delete Folders
-
Use WinRAR to Force Remove Folders
Summary
- Typically you cannot delete a folder because it is in use by an app, or it is a Windows folder. If neither of those apply, you may be able to forcibly delete it.
- To delete a folder with Command Prompt, run Command Prompt as an Admin, then run: rmdir /s /q PATH/TO/FOLDER
- Try booting into Safe Mode to minimize the chances of a program using the folder you want to delete, then try deleting it again.
Are you having trouble deleting a folder from your Windows 10 or Windows 11 PC? If so, that may be a system folder or a folder being used by other apps. We’ll show you how to successfully delete «undeletable» folders on your computer.
Why You Can’t Delete a Folder on Windows?
The most common reason you can’t delete a folder is that your folder is a Windows system folder. In this case, the system prevents you from removing the folder as it can make your PC unstable.
If you’re sure yours is not a system folder, then your «undeletable» folder may be in use by your installed apps. When a folder is being used by an app, Windows prevents you from making changes to that folder. In this case, you can close the app using your folder and then try to delete the folder.
If your case doesn’t match either of the above scenarios, you may want to use one of the following methods to force remove your folder.
Use Command Prompt to Remove Write Protecion
One quick way to force delete a folder is to use Command Prompt. You can run a command from this tool that deletes your selected folder.
To do that, first, open your «Start» menu and search for «Command Prompt». Then, on the right pane, click «Run as Administrator.»
You’ll see a «User Account Control» prompt. Select «Yes.»
When Command Prompt opens, type the following command and press Enter. In this command, replace PATH
with the path to the folder you want to delete.
If your path has spaces in it, enclose the path with double quotes.
rmdir /s /q PATH
For example, to delete a folder named Unwanted
in the Documents
folder on your C
drive, you’d use the following command.
The command permanently deletes your folder, so make sure you really want to do that.
rmdir /s /q C:\Documents\Unwanted
The specified folder is now removed from your Windows PC, and you’re all set.
Boot Windows into Safe Mode to Delete a Folder
If you aren’t sure what app has hijacked your folder so you can’t delete it, reboot your PC in safe mode and then try to delete the folder. In safe mode, your PC only loads the essential Windows files, preventing any third-party apps from automatically launching.
To use this method, first, boot your Windows 10 or Windows 11 PC in safe mode using our guide.
Once you’re in safe mode, launch File Explorer and locate the folder to delete. Then, right-click this folder and choose «Delete.»
Your folder is now deleted.
You may want to remove the folder from Recycle Bin as well, which you can do by opening the Recycle Bin, right-clicking your folder, and choosing «Delete.»
And that’s all there is to getting rid of stubborn folders on your PC. Enjoy!
Use Third-Party Software to Delete Folders
If your folder still won’t delete, there’s a free third-party app called Unlocker that can help you remove your folders. This app basically unlocks your folder from any locks due to which it can’t be deleted, and then allows you to finally get rid of the folder.
To use this method, first, download and install the free Unlocker app on your PC. Then launch the newly installed app.
On Unlocker’s main window, choose the folder to delete. Then, at the bottom, click «OK.»
On the screen that follows, click the drop-down menu and select «Delete.» Then click «OK.»
Unlocker will unlock your folder and delete it from your PC. You’re all done.
Use WinRAR to Force Remove Folders
This might sound strange but you can use WinRAR (a file compression app) to delete your stubborn folders. The way this works is that you create an archive out of your «undeletable» folder and then ask the app to delete the original folder after the archive is made.
That way, when WinRAR has created an archive from your folder, it deletes the original folder. You can then delete the newly-created archive as well.
To do that, first, grab the free version of WinRAR and install it on your PC. Then restart your Windows 10 or Windows 11 PC so WinRAR integrates with your context menu.
When your PC turns back on, open File Explorer and find the folder to delete. Then right-click this folder and choose «Add to Archive.»
On the «Archive Name and Parameters» window, in the «Archiving Options» section, enable the «Delete Files After Archiving» option. Then, at the bottom of the window, select «OK.»
Let WinRAR make an archive from your selected folder. When that’s done, WinRAR will remove the original folder. At this point, you may now delete your newly created archive.
And that’s how you go about ridding your Windows PC of any unwanted and stubborn folders. Very useful!
While you’re at it, consider clearing your Windows PC’s cache to get rid of unwanted files from your storage.