Deleting most files or folders on Windows is as easy as selecting what you want to delete and clicking the Delete button. However, when dealing with large files or folders, it could take a long time to perform the deletion. In this post, we’ll discuss the best way to instantly delete large files and folders.
Good to know: alternatively, check out how you can view large files on Windows without lag.
Why Does It Take So Long to Delete Large Files or Folders?
When wanting to delete a sizeable file or folder of 10GB or more, Windows can take up to ten minutes to perform the deletion, especially on HDDs. That’s because Windows performs some steps in the background first, including counting the number of files, identifying their types, and more.
How to Instantly Delete Large Files or Folders using Command
To instantly delete large files or folders, we’ll need to instruct Windows to skip the pre-deletion steps. Although it sounds like an unsafe action, it’s really not! Windows has a built-in command that can perform this action.
This method relies on a Command Prompt command, and since it’s impractical to run it every time you need to instantly delete something, we’ll create a batch file (BAT) that performs the command on demand.
Note: when you delete a file or folder this way, it gets permanently deleted and will not be sent to the Recycle Bin.
- Type “notepad” in Windows Search to open the Notepad app.
- Copy the following command to the text file:
del /f/s/q %1 > nul<br>rmdir /s/q %1
- Click “File -> Save As.” Select the drive or folder that has the file you want to delete stored in it. Name the file as you like. Most importantly, at the end of the file name, delete the .TXT extension and add .BAT to save it as a BAT executable file.
- Now, when you need to instantly delete a large file or folder (you can also use it to delete small ones), drag and drop it over the BAT file, and it’ll launch the command and instantly delete it (without confirmation, so be careful).
Tip: check our list of best context editors for Windows.
If you’re uncomfortable using the BAT file method, you can create a context menu option that does the same thing via the Registry Editor. Let’s see how.
- Launch Notepad.
- Copy and paste the following code.
@ECHO OFF ECHO Delete Folder: %CD%? PAUSE SET FOLDER=%CD% CD / DEL /F/Q/S "%FOLDER%" > NUL RMDIR /Q/S "%FOLDER%" EXIT
- Click “File ->Save As” and save the file as “instant_delete.bat.” Make sure you’re saving it in the “C:\Windows” folder since it needs to be on the system partition.
Note: If Windows refuses to save the file in the “C:\Windows” folder due to restrictions, save it on the desktop and manually move it there.
- Press Win + R and type
regeditto open the Registry Editor.
- Navigate to the following path manually or copy and paste it into the path field.
- Right-click the “shell” key on the left and select “New -> Key.”
- Name the newly created key “Instant Delete” or any other name you like. The name you choose will appear in the context menu. Press Enter to save the name.
- Right-click the new key and select “New → Key” to create a sub-key. Name it “command” (or anything else) and press Enter to save.
- On the right, double-click the “Default” key and paste the following code.
cmd /c "cd %1 && instant_delete.bat"
- Close the Registry Editor and restart your PC.
- Upon your return to the Windows environment, you should see the option “Instant Delete” when you right-click the large file or folder you wish to delete.
- Clicking it will open the CMD. Press any key to confirm that you wish to delete the file or folder. Note that the deletion is also permanent.
FYI: check out more registry hacks for a more optimized Windows experience.
Fixing the “You Don’t Currently Have Permission to Access This Folder” Error
Sometimes users might see the error “You don’t currently have permission to access this folder” when trying to delete files and folders large or small. The easiest way to delete these files and folders is to take ownership of them. Our post also includes additional solutions to dealing with this error, in case taking ownership does not work for you.
Fixing the “File Is Open in Another Program” Error
Sometimes the deletion process fails because the file or folder is opened or accessed by another problem. Although there are several fixes to the “File Is Open in Another Program” error, the easiest way to deal with it is by using Microsoft’s PowerToys utility.
PowerToys is an app that allows Windows users to access extra features that are not built into Windows. Microsoft developed it based on the contributions of developers around the globe.
- Download and install PowerToys.
- Launch the app and activate the “File Locksmith” feature.
- Navigate back to the file or folder that shows the error and right-click it, then select the “What’s Using This File?” option.
- A pop-up window will let you know what app is using this file or folder. If there are results, click “End Task.” If there aren’t, click the refresh icon in the top-right corner to use administrator privileges to check again.
- After you click the “End Task” button, you can immediately delete the file or folder using the methods outlined earlier.
Tip: can’t acess your Task Manager because it has been disabled by an administrator? Check our list of fixes and solve the issue.
Frequently Asked Questions
What happens when I delete a file in Windows?
When you press Delete when selecting a file or folder, it gets moved to the Recycle Bin so you can restore it later. However, when pressing Shift + Delete, the files get permanently deleted. Still, there are methods to help you restore them.
What happens when I delete a file on a flash drive?
When you delete a file on a flash drive or an external hard disk, it gets permanently deleted. Still, you can add a Recycle Bin to the flash drive to prevent losing important files by mistake.
How can I permanently delete a file on Windows?
Image credit: Flaticon & Pixabay. All screenshots by Mustafa Ashour.
Subscribe to our newsletter!
Our latest tutorials delivered straight to your inbox