Random Files locked for editing

Jryals8900 used Ask the Experts™
We have several servers in a VMWare environment that have file shares that are deployed via mapped drives to a terminal server with about 40-50 users on it. The server os used on all is Server 2008 R2 with all latest patches.

A few months ago the servers locked up and had to be rebooted due to issues with one of our SANs. Since that has happened random files have been giving users an error message when they attempt to open them. It actually lets them open the files after a second attempt which is clearly showing something is glitched out.

"xxx.docx is locked for editing by 'another user' "

Sometimes it would actually say the users name, one time it even said the name of a user that didn't even work there anymore.

I ended up resetting ownership of all 250GB worth of files to the administrator account, and gave Domain Users read/write and modify permissions. I essentially stripped ANY custom permissions and made the files appear to Windows as if they had always belonged to the admin and reset all permissions to a blank slate and this is still happening. Any ideas? I'm posting a picture of the file below as well. Any help would be appreciated and if more info is needed please ask. Thanks!
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Robin CMSenior Security and Infrastructure Engineer
If the files are held on Windows File Server you can go into computer management on the file server and look at System Tools, Shared Folders, Open Files which will tell you the files that are open and who has them open. You can see which workstations files have been opened from in Sessions.
If you have Excel 2010 or 2007 there is (was) a known problem where the wrong name might be displayed as the person locking the file.
Loads of stuff for you to check through in this article: http://blogs.technet.com/b/the_microsoft_excel_support_team_blog/archive/2012/05/14/the-definitive-locked-file-post.aspx
and even more stuff in the comments.
btanExec Consultant
Distinguished Expert 2018
Maybe useful insight as shared by user in forum on similar experience
So if you receive the "Unable to access a file since it is locked" when powering on a VM, or receive an error about can't find the file when trying to deploy a new VM from a template, check ALL your VM's vmx files to make sure that one of them is not actually using that template/VMs VMDK file.

 also I am thinking the locking may be due to backup process as well
Note: Locked files can also be caused by backup programs keeping a lock on the file while backing up the virtual machine. If there are any issues with the backup, it may result in the lock not being removed correctly. In some cases, you may need to disable your backup application or reboot the backup server to clear the hung backup.

This lock can be maintained by the Service Console for any hosts connected to the same storage.



Thanks Robincm:
The error message as far as I'm aware is completely separate from VMWare. It is not associated with powering the VM. All VM's could have been on for weeks and the error message is displayed at random times throughout the day.

That link you provided in the second paragraph does seem helpful however the link going to Server 2008 R2 is an update rollup so it's likely it was already installed. I will go through the update history and varify. Edit: I may be mistaken on this I think I clicked the link for Itanium and not 2008 R2 x64. Will review.

Thanks BTan:
The error message you show is different, that's a VMWare error message for deploying templates. The error message we're getting is associated with a Windows locked error message.

I have checked the backups but they are running from within the VM, not outside. There don't appear to be any errorsin the backup logs either. Backups were not occuring during the lockup and force reboot so that shouldn't be it but I can check with another tech here to see.
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Exec Consultant
Distinguished Expert 2018
Thanks for the clarification. The MS kb stated for this error
This behavior may occur if Word determines that the owner file for the document already exists. This may occur if one or more of the following conditions are true:
Word previously quit improperly and, therefore, did not delete the owner file.
A second instance of Word is running in the background with the document already open.
The document is shared over a network, and another user has it open.
In short, Word creates an owner file when you open a previously saved Word document. An owner file is temporary and holds the logon name of the person who opens the document.


In most case I experienced, it has to do with mapped drive storing and accessing the document by all assuming the legit users are granted access to that folder. Seldom we see this "lock' if we used notepad or wordpad to open instead of Word office. Of course, the concurrency checks is critical to ensure no race condition tampering the document integrity.

In specific, the locked files are mostly due to Temp Directory use by MS Office. Word places this copy in the Windows Temp directory every time the document is opened and accessed. So when you open a file that stated it is locked, it is either because it is already open
a) in another window of Word; or
b) by another user on the network; or
c) its document template attached to a document is likewise already in locked stated (e.g. Word automatically makes a copy of the template in the Temp directory too).

As a whole, the copy of a locked file does not automatically update the original owner's file till the document is fully closed. This may be the crux of issue as scheduler or backup service or indexer service (Windows Indexing service) or user that open/access it w/o proper closing the document, the temp copy will also be existence and locked case will persist and happened.

What other checks to help alleviate and find root cause (just some thoughts below)  ----

1) Go to Computer Management -> System Tools -> Shared Folders -> Open Files to find out who has a document locked. If the user can't be contacted to disconnect themselves, you can forcefully do so by right clicking the locked file and selecting Close Open File (warning: the user might lose their changes).

2) Doing some diligence checks to ensure
a) no one is opening it and enforce more stricter ACL on the folder,
b) use shorter filename and not too deep of subfolder depth (saw some forum stated saving error)
c) clean up temp folder and monitor with simple tool like OpenedFilesView and LastActivityView to check multiple run by specific process and user, and various application access the files
d) consider using tool to unlock e.g unlocker - a program which unlocks locked files or folders. (OpenCandy adware, just uncheck it while installing or use the portable version.)


This issue occured after a server crash. There is no one opening the files at the time of the messages in fact several times it has shown as locked by users that didn't work at the company anymore. Also the fact that it is saying it to users and then allowing them to open afterwards points to some sort of glitch.

I have also opened a Microsoft ticket but all they did was recommend the hotfixes that robincm posted so I will try that first. I will also try the open files program  by Btan and see if it can see the Owner temp files associated with these "open" word documents.
Robin CMSenior Security and Infrastructure Engineer

Let us know how you get on! Hopefully the hotfixes will do it.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial