0

Running into an issue that I've been banging my head against for a while now. We use a shared executable located on a network share. It's an in house system and we occasionally update it. Recently we started running into issues where the EXE is locked and so we cant rename and replace it. Our standard release procedure has always been just to rename, and replace the file. Maybe not the most elegant but it has always worked pretty well.

Migrated to Server 2012 R2 about 6 months ago and it has been working fine apart from this.

I think I'm running into opportunistic locking https://support.microsoft.com/en-us/kb/296264 but I'm not sure of a way around it. Anyone have any thoughts?

Thanks

Nick
  • 1
  • 1
  • Have you tried the Share management MMC to see if you can find who's locking it? Also, you can just kick whoever it is, and replace it... – EliadTech Mar 18 '15 at 12:36
  • Share managment shows the file open okay but 0 locks. – Nick Mar 18 '15 at 12:44
  • Right click (where EliadTech said, under Open Files) and close any connections to the file and then try again. If that doesn't fix it, then a real-time virus scan tool might have it locked as well (you can restart that scanning service to confirm). – TheCleaner Mar 18 '15 at 12:47
  • Closing the connection works but I was hoping for something a little less reliant on manual input. I'll take a look at virus scanning and see if its locking it. – Nick Mar 18 '15 at 14:05

1 Answers1

0

You will need to close the connections to the file in order to rename a file or replace it.

You can figure out who has the file open in Computer Management, under Shared Folders, Open Files. Find the file in question and right click on each connection and close their connection to the file.

If after doing so it still isn't unlocked you can use Unlocker (free online) to attempt to remove any locks, or restart any real-time virus scanning service and see if that unlocks the file.

TheCleaner
  • 32,352
  • 26
  • 126
  • 188