How to force the deletion of a locked file that has no locking handle on Windows?
Solution 1:
We are always glad to help, but just to double-check (since you didn't elaborate), are you certain that this isn't a critical operating system file?
If you are confident that this isn't an essential OS or application file, you can always utilize a Linux Live CD of some type and navigate to the file accordingly. Under those circumstances, it won't be constrained by the Windows operating system and can easily be deleted.
If you are trying to completely delete the Windows.old
folder, that is understandably frustrating. I have encountered similar problems following a Windows 10 upgrade, and was finally able to delete it by booting into a command prompt. Try utilizing the following method:
- While logged into Windows 10, open the Run window by holding + R
- Type
shutdown /r /o /f /t 00
in the subsequent window, then press Enter -
After the system reboots, click on Troubleshoot
-
Click on Advanced Options
-
Click on Command Prompt
The ensuing window will ask you to Choose an account to continue
- Select a local administrator account, type in the appropriate password, and click on Continue
- Within the command prompt, type
diskpart
and press Enter (as seen below) - In the command prompt, type
list volume
and press Enter - From the listed volumes, look for and verify the drive letter of your Windows 10 drive.
-
In the command prompt, type
exit
and press Enter Ensure that you substitute "D" in the command below with the actual drive letter of your Windows drive as displayed from step 10 (above).
- To delete the "Windows.old" folder, type
RD /S /Q "D:\Windows.old"
and press Enter - Close the command prompt window.
- Back at the Choose an option window, click on Continue to restart the computer.
(Source: How to Delete Windows.old Folder in Windows 10)