Archive: Replacing file with new file when it is in use


Replacing file with new file when it is in use
For my software for during reinstall and update of s/w i need o check whether files related to my software is open before replacing it with new one. So if the file is in open then i copy latest file with another name and was using Rename /rebootok so that the file is renamed during reboot.

But in some server they dont restart the server as it works 24*7. In that case how i can do renaming etc. So rebootok does not help in this case. So what can be done?


Rename the file then delete the renamed file with /rebootok. Depending on how the file is locked it is sometimes possible to rename even if you cannot delete.


Originally posted by Anders
Rename the file then delete the renamed file with /rebootok. Depending on how the file is locked it is sometimes possible to rename even if you cannot delete.
Forgot to mention that i am planning to do it.Renaming the file when it is open is allowed for some files such as exe files.So i can rename the file and replace that file. But in case of pdf files it does not allow to rename also. So what is the solution for this cases?