Delete file lock windows

How to Delete a Locked File in Windows 10

By Bryan Clark 04 July 2017

When you run into a locked folder in Windows 10, the system won’t allow you to do anything with it — open it, delete it, or move it — without the password. For folders that you didn’t lock, finding the password often isn’t an option. You can’t open these folders, but you can delete them — even though a simple right-click “Delete” won’t work, nor will the delete button.

It should be noted, however, that deleting these files could wreak havoc on your system if you’re not sure why they’re there in the first place. Proceed with caution.

1. Locate the folder you wish to delete. I don’t have any locked folders I’m willing to delete, so let’s create an unlocked folder — and call it SkypeHost.exe (a copy of an actual locked file) — for the sake of the tutorial. It works the same, but you can just as easily remove this folder with the delete button.

2. Download Process Explorer from Microsoft’s website, and press OK on the pop-up window.

3. Double click processexp64 to extract the file.

4. Choose Extract All.

5. Click Open.

6. Double click the procexp64 application to open the application.

7. Select Run.

8. Read the terms and press the Agree button.

9. In the Process Explorer window, choose File > Show Details for All Processes.

10. Allow the app to make changes by pressing the Yes button.

11. Go the the Find menu at the top and select Find Handle or DLL.

12. Type in the file name and hit Search.

13. Right click the process in the bottom of the Process Explorer screen and select Close Handle. If there are multiple processes listed here, you’ll need to repeat this step to close all of them.

14. Delete the file as you would normally.

How to delete a file “locked” by Windows system

I have this annoying problem when I want to place a new version of my exe overnight on the server (by a .Net program) when some user did not close the exe when leaving office (all users use this exe ON the server).

Читайте также:  Reading linux files in windows

Simple reproduce method:

  • put exe on a shared network drive (Windows Server)
  • open de exe op pc1 (WIN7)

delete this exe on pc2 (WIN7) =>file is not deleted but there is no longer a owner of the exe file, not even an Admin; and there is no way to put back a owner on the file because nobody has rights to do that anymore (not even an Admin).

quit de exe op pc1 =>The exe is not visible in open files and not possible to delete the file (Explorer or Elevated command prompt)

I’ve already tried several «unlocker» tools but none of them could unlock the file because they don’t see that the file is locked. But I think the file is locked by Windows system until the user who was in de exe overnight quits the exe; and then Windows will do the real delete.

The problem is that the «to delete» exe is in someway «corrupt» so you can not longer open this exe.

Is there a way (.Net code) to force to give this file back a owner (Admin for example) so that this owner can delete the file permanently?

Remark: because a lot of users use this exe it is not possible to look on every computer if the user is still in the program or run ProcessExplorer on every pc.

How to delete undeletable & locked files, folders in Windows 10

If you are unable to delete undeletable, locked, ghost folders or files from Windows computer use CMD or a file deleter software to delete undeletable & locked files and folders in Windows 10/8/7.

At times you may find that you are just unable to delete a file or folder on your Windows computer. When you go to delete such ghost or undeletable files or folders you may get an Error message: Could not find this item.

Alternatively, you may also get the following messages:

  • Cannot delete file: Access is denied
  • There has been a sharing violation.
  • The source or destination file may be in use.
  • The file is in use by another program or user
  • The file or directory is corrupted and unreadable.
  • Make sure the disk is not full or write-protected and that the file is not currently in use.

Delete undeletable & locked files, folders

If you cannot delete files or folders in Windows 10 and then try these suggestions to delete the undeletable & locked files, folders:

  1. Reboot and try
  2. Delete in Safe Mode
  3. Run ChkDsk
  4. Use CMD or PowerShell
  5. Use File deleter software.

1] Reboot and try

First, reboot and see if you can delete it.

2] Delete in Safe Mode

Boot in Safe Mode and then try to delete it

3] Run ChkDsk

Run ChkDsk, and then see if you can delete it.

4] Use CMD or PowerShell

Use the del command to delete undeletable files:

Use the RMDIR or RD command to delete undeletable folders:

  • /S : Delete all files and subfolders in addition to the folder itself. Use this to remove an entire folder tree.
  • /Q : Quiet – do not display Y/N confirmation

Be very careful while using this method and use the correct commands.

5] File deleter software

If these methods fail, I suggest you download and use a free file deleter software to delete locked files and folders.

Free File Unlocker, Delete Doctor, Unlcoker, Tizer UnLocker, MoveOnBoot, Wise Force Deleter are some free file deleter software that can help you delete undeletable, hidden, ghost files and folders.

Unlocker unlocks the file or folder if it is being used by any other program and allows you to delete it. Its Explorer integration is a big help, as all you have to do is right on the undeletable folder or file and click on Unlocker.

If no locking handle is found, it will still delete the folder.

Unlocker is a handy tool to have around in such circumstances, BUT it comes with a pre-checked option of installing a QuickStores toolbar for eBay, Amazon & Shopping.com. It also places two eBay internet shortcuts on your desktop. You may want to uncheck these options.

Date: August 20, 2019 Tags: Folder, Freeware

Neat Download Manager for Windows 10 will speed up your downloads

Best Free Ping Monitor Tools for Windows 10

Best Free 8085 Microprocessor Simulators for Windows 10

[email protected]

Anand Khanse is the Admin of TheWindowsClub.com, a 10-year Microsoft MVP (2006-16) & a Windows Insider MVP. Please read the entire post & the comments first, create a System Restore Point before making any changes to your system & be careful about any 3rd-party offers while installing freeware.

Primary Sidebar

report this ad

How to delete locked files on Windows 10

When a file is open by another app or process, Windows 10 puts the file into a locked state, and you can’t delete, modify, or move it to another location. Usually, after the file is no longer in use, the application will unlock it automatically, but that’s not always the case. Sometimes, a file may not unlock successfully, and even if you try to take any action, you’ll see a warning that the operation can’t be completed because it’s open by another program.

If you must delete or take different actions with a locked file, there are at least two methods you can use to unlock it, including using Microsoft’s Process Explorer tool and Safe Mode.

In this Windows 10 guide, we walk you through the steps to get rid of files even if they’re locked by an app or process.

How to unlock files using Process Explorer

If you need to unlock a file currently being used by a program or system process and you can’t restart your device, you can use these steps:

  1. Download Process Explorer from this Microsoft website.
  2. Extract the content inside the ProcessExplorer.zip compressed folder. (You can refer to these instructions if you need additional help on how to do this task.)

Double-click the procexp.exe if you’re running a 32-bit version of Windows 10 or procexp64.exe if you’re running a 64-bit version10 to launch the app.

Click on File, and select the Show Details for All Processes option.

Click on Find, and select the Find Handle or DLL option.

Type the name of the locked file in the field, and click the Search button.

Behind the search window, in «Process Explorer,» right-click the locked file, and select Close Handle to unlock it.

  • Important: If the file is being used by more than one process, repeat the steps to close all handles.

Once you complete these steps, you can go ahead and safely delete or modify the unlocked file.

How to unlock files using Safe Mode

Usually, when you come across a locked file, you can simply restart your device to unlock it. However, if the application has a service that loads during startup, it might keep locking a file as soon as you sign in. You can either disable the app from loading at startup, or you can boot into Safe Mode to unlock and delete the file. Here’s how:

  1. Open Settings.
  2. Click on Update & Security.
  3. Click on Recovery.

Under «Advanced Startup,» click the Restart now button.

Click on Troubleshoot.

Click on Advanced options.

Click on Startup Settings.

Click the Restart button.

On «Startup Settings,» press F4 to enable Safe Mode.

While in Safe Mode, use File Explorer to locate and delete the files that were previously locked, then simply restart your device as you would normally to exit Safe Mode.

Wrapping things up

Although there a number of tools available on the internet designed specifically to deal with locked files, on Windows 10 there is more than one way to remove these type of files without having to get software from unknown sources.

It’s important to note that unlocking and deleting files on Windows 10 may cause system and program issues, depending on the type of files you’re trying to unlock. So be careful of what you delete if you’re not sure of the consequences.

More Windows 10 resources

For more helpful articles, coverage, and answers to common questions about Windows 10, visit the following resources:

We may earn a commission for purchases using our links. Learn more.

Halo: MCC’s live service elements make it better, not worse

Halo: The Master Chief Collection is more popular than ever, but some fans don’t agree with the live service approach 343 Industries has taken with it. Here’s why those elements are, at the end of the day, great for the game and for Halo overall.

Microsoft’s Surface Duo is not ‘failing up’

Microsoft announced this week that it was expanding Surface Duo availability to nine new commercial markets. While Surface Duo is undoubtedly a work in progress, this is not a sign of a disaster. It’s also doesn’t mean that Surface Duo is selling a ton either. Instead, the reason for the expansion is a lot more straightforward.

Here’s what you can do if Windows 10 update KB5001330 is causing issues

In this guide, we’ll show you the steps to get rid of the update KB5001330 to fix profile, gaming, and BSoD problems with the Windows 10 October 2020 Update and May 2020 Update.

These are the best PC sticks when you’re on the move

Instant computer — just add a screen. That’s the general idea behind the ultra-portable PC, but it can be hard to know which one you want. Relax, we have you covered!

Читайте также:  Hp laserjet pro mfp m28 m31 драйвера windows
Оцените статью