0

We have some Vb.Net applications internally used in our company. Those will be hosted in our windows server 2012 and will be accessed from all client machines(windows xp,7 and 8) in network. When we build newer versions of the application, we will replace the existing exe files in server by renaming old exe files as Application1_Old.exe and will put new file in the name of Application1.exe. Normally It allows to rename the file even when application is open in client PC.And that user will get new features once he closes the application and reopens it. So we where replacing the .exe when they are open in client.

So Windows server will allow to rename the vb.net exe/dll files which are open from network or locally.This feature is found in windows server only.

Problem case: But sometimes this will not allow to rename for some files. But if we try after sometimes for the same file, it will allow. This error is not file specific and not regular. When this error comes we have to close the existing connections of the application in OpenFiles and then do renaming.

I don't know when this problem will come and when won't come. Previously by my observation I found that if any exe file is open in any windows7 PC, then it won't allow to rename in server. So we were closing the open connection only from that PC. It was allowing to rename afterwards.

Later on we have upgraded some PCs to windows 8. After upgrading the number of this problem cases is increased. I feel that it is related to windows7 or 8 only,but not sure . Some features may be by default enabled in win XP but may be disabled in Windows 7 and above. I have also got information like "When a client has the file handle locked, we can't rename the file" . But we are able to do it from past few years as i said before. So how is this possible? Does anybody facing the same issue? How can I troubleshoot this issue? What may be the cause for now not able to replace the file?

IT researcher
  • 3,274
  • 17
  • 79
  • 143

1 Answers1

1

Well I am not surprised that you can rename a executable when it is running on a client machine. This is not the recommended way to deploy your application.

You should have a look into clickonce deployment. This allows you to deploy to a web server or a file share. Clients then install the application locally, so you can perform updates regardless of whether someone if using your application or not.

This previously asked question is similar to yours: How can we overwrite EXE files while users are running them?

As a last ditch attempt you may also want to have a look at InUse.exe "provides individuals and administrators with "on-the-fly" capability to replace files that are currently in use by the operating system"

Community
  • 1
  • 1
Matt Wilko
  • 26,994
  • 10
  • 93
  • 143
  • InUse.exe will replace the file only after PC restart as it uses "PendingFileRenameOperations". What if i disable "Opportunistic Locking"? – IT researcher May 14 '14 at 06:03