Sometimes the file or folder may not be removed easily from your PC. If some application is utilizing desired file or folder, the ‘File in use’ or ‘Folder in use’ dialog box prompt when tried to delete manually. Some files may even need admin permission to delete. Or some may be readonly files, forbidding edits.
But, if you’re looking for smoother ways to force delete such stiff folders or files, you should definitely go through this article.
How to Force Delete Folders or Files on Windows?
You may need to provide admin permissions to delete files and folders. Generally, system files require permission to get removed. Depending upon your knowledge of that file, you can grant permission and delete if a dialog box prompts asking admin request while deleting.
Now, try the methods given below to force the delete folders or files:
Using Keyboard Shortcut
You can delete selected files and folders to be removed. The shortcut involves clicking the file or folder once, then pressing Del key while you hold the Shift key. This method will permanently delete files or folders from your computer, which means you won’t be able to find them in the Recycle Bin.
End Task From Task Manager
The files and folders which are being used by any running applications cannot be deleted. You must close the associated app to delete such files and folders from Task Manager window. Follow the steps mentioned below to halt interrupting operations:
- Press Ctrl + Shift + Esc keys to open Task Manager.
- Right-click on the application or the process you need to end.
- Select the End Task option.
- You can also stop the Background processes from the section placed below Apps by following the same procedure. Once you stop the process, you can proceed to delete files and folders with the methods given in this article.
Through Command Prompt
Folders or files can also be deleted by executing command lines in cmd. Many commands also provide added features to perform a task making them more flexible than their GUI counterparts. Delete commands in cmd will let you bypass operations hindering the file or folder removal process.
Follow the mentioned steps to delete a file through the command:
- Press the Windows key + R keys to open the Run command.
- Type cmd and hit Enter. Hit Shift + Enter after you type cmd if you need administrator mode of cmd to delete files or folders requiring admin permission.
- Run the command,
del C:\Folder\filename.exe, where C:\Folder\filename.exe is the path of your file)
- There’s another command to delete a folder, as the del command is only for files. Enter
rmdir “folder path”to remove a folder.
Both of these commands come with numerous parameters to ease the task. For example, if you enter:
del /r “file path”, you can delete readonly files as well.
Safe Mode Deletion
The OS functioning may be interrupted by various external devices and their drivers, which constantly utilize various files. Many unmendable background processes like Antivirus’ doesn’t let you delete their in-use files.
And in safe mode, neither most of the driver’s work nor any third-party background or startup processes run. Thus, safe mode makes it easier to force delete files or folders.
To enter safe mode, follow the steps below:
- Click on the Start menu in the taskbar and then the Power icon.
- Hold the Shift key and choose the Restart option.
- Wait till it opens the Windows Recovery Environment and Click on Troubleshoot.
- Go to Advanced options.
- Select Startup settings.
- Tap on the Restart button
- Choose any numbered key with the Safe mode option(Usually on ‘4’).
Windows will load now in safe mode, navigate to the dedicated folder or file and remove it by clicking right-clicking and then delete.
How to Force Delete Files or Folders on Mac?
To force delete files on mac, use the methods below:
Use Keyboard Shortcut
Select the file or folder you want to remove, then press
command + delete. If confirmation asking message prompts, you can confirm that to delete. Locked files or folders may need confirmation.
Force Quit Delete
To delete a file or a folder being used by any executing application, you can first force quit it, similar to ending a task in Windows.
- Open the Force Quit applications by pressing Option + command + Esc.
- Select the application associated with the file or folder, then click on the Force Quit button.
Use Terminal Commands
The Windows counterpart for the Command Prompt in Mac is the Terminal. You can use the terminal command to delete the desired file or folder. Follow the steps below:
Command + Space, which opens the Spotlight.
- Search terminal and hit Enter.
- Now, type
sudo rm -Rfollowed by a space(mandatory).
- Navigate to the file or folder and drag it to the terminal.
Upon hitting enter, it will automatically force delete the desired file or folder.
Safe Mode Deletion
To enter safe mode and delete files or folders on Mac, follow:
- Click on the Apple logo in the top-right corner and choose Restart… and click on Restart.
- Press the Shift button on the keyboard till Login Window shows up.
This means you have entered safe mode now. Then, you can try any of the above ways to delete the file. Or just manually drag the desired item to Trash.