If you work in IT, you’re probably familiar with Microsoft Windows users constantly locking files where others are not able to edit them. The problem of locked files seems to be most common with Microsoft Excel users.
It’s very common for users to leave an Excel spreadsheet open, causing an “Excel is locked for editing by another user” error to display for other users attempting to make changes to the spreadsheet.
If you have admin rights, you can force a disconnect and release the file lock using these steps.
Note: If you do not have permissions to release file locks, you may want to ask a person who does to grant you access or ask them to perform these steps.
- Hold the Windows Key and press “R” to bring up the Windows Run dialog screen.
- Type “mmc“, then press “Enter“.
- Go to “File” > “Add/Remove Snap-in…“.
- Scroll down and select “Shared Folders“, then choose “Add“.
- Select “Local computer” if you are logged into the computer or server where the file resides. Otherwise, select “Another computer“, then type the Computer Name of the other computer. You may also select “Browse…” to find the computer name.
- Select “Finish“.
- Select “OK“.
- Expand “Shared Folders“, then select “Open Files“.
- Find the file that is locked, then right-click it and choose “Close Open File“.
Now if you have the other user close the application, then re-open the file, they should be able to edit it without a locking issue.
This post applies to Windows 10, 7, 8, Server 2008, and Server 2012.
Brendan says
Thank you. I’ve used this page a few times now. Very useful.
Andy P says
Thank you for the article. This saved me from restarting the server.
Russell Bride says
I found out that System was holding on to a file that was shared, even though it shouldn’t normally. And with this tip I could fix the problem. The sysinternals tool handle couldn’t for example get rid of the lock.
Kenneth Bopuchard says
I need to remove all the locks system wide, so that Linux has access to them to delete files and folders.
I actually onlly need it on The second partition of my Windows 10 drive. It is aspparrently not possible.
Someone said to deiable hibernation in Windows 10 but I cannot seem to find it.
Marcos says
Many thanks! it was very helpful.
nathan says
i got to the point where it said find the locked file but there were none so i thought that that wasn’t the issue and closed mmc.
then just for the heck of it i tried opening the file again and guess what – it came up with no lock issues.
Thanks so much for this helpful post!
Stewie says
Thanks I really appreciate it. Like others I’d never discovered this in decades of scientific and IT work. Maybe I didn’t need it, but today I did! file locked by another user across a network.
Ivo says
Thank you, very useful! Windows 10 told me that the file is locked by user X (but his computer was shut down) and through MMC i found out it was wrong and it was opened by user Y.
Gabe says
Firstly, thanks for posting this. I’ve been in IT for 20 years and had no idea how to do this.
Secondly, Mike on Nov 17, 2018 said “caused me to delete the file”. What he meant was the entry in the “Open File” list is removed, thus removing the lock. The original file is NOT deleted, for those who might be concerned.
Mike says
Thank you, these instructions caused me to delete the file.
jimmy666 says
The file lock in Windows is an insanely annoying but when it is used, the security of your system and your data is really all dependable.