The Blog

Quick PowerShell Command to Clear VMware Workstation File Locks

VMware workstation uses file locks with the extension of .lck to determine if a file is in use. Occasionally these locks are not removed properly which causes an issue when you try to open or run the virtual machine. The error will state that you were unable to take ownership as the file is already in use. The solution is to simply to remove the orphaned lock files by deleting them.

You can do this manually but if you have many VMs to account for PowerShell is a better method.

Get-ChildItem "VM_FOLDER_PATH" -Recurse -Include *.lck | Remove-Item -Recurse
Neil Bryan
IT Consultant & Technical Trainer
Neil Bryan is an IT consultant and technical trainer specializing in VMware, Citrix and Microsoft virtualization and infrastructure.

Leave a Reply

Skip to toolbar