How to unlock running executable

  • Thread starter Thread starter Peter Beno
  • Start date Start date
P

Peter Beno

Hi

(Not sure this is the all proper group, but i have not found any windows
developer general one...)
Is there any way how to unlock running executable, so it can be
rewritten/deleted on disk - or more important on network drive? Something in
a way to tell windows to copy the executable into memory/swapfile and
release all locks on executable file - done from inside executable that is,
not from outside.
Thanks

Pete
 
Hi Peter Beno,
Hi

(Not sure this is the all proper group, but i have not found any
windows developer general one...)
Is there any way how to unlock running executable, so it can be
rewritten/deleted on disk - or more important on network drive?
Something in a way to tell windows to copy the executable into
memory/swapfile and release all locks on executable file - done from
inside executable that is, not from outside.

- you can rename the EXE
- you can delete it with MoveFileEx (with MOVEFILE_DELAY_UNTIL_REBOOT)

See: MoveFileEx
http://msdn.microsoft.com/library/en-us/fileio/base/movefileex.asp

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/
 
- you can rename the EXE
- you can delete it with MoveFileEx (with MOVEFILE_DELAY_UNTIL_REBOOT)
Thanks for repply, but that does not really work, beause:
- the file is on network drive (on novell netware) so im afraid delete on
reboot wont work
- for the same reason, i can rename it, but still can't delete it (which is
almost good enough actually)
The whole point it to put new release of application on same place even
while old one is still running on nobody knows how many computers. I did it
other way do far, copy application file to temp dir and rerun it from
there...
Thanks

Pete
 
- you can rename the EXE
Why can´t you rename it ? Is this a bug from novell?
I can rename, just cannot delete (read carefuly:) ). It just leaves a bit of
junk in file system if i forget to delete it later. Looks like best solution
for me actually.
Thanks

Pete
 
Hi Peter Beno,
I can rename, just cannot delete (read carefuly:) ). It just leaves a
bit of junk in file system if i forget to delete it later. Looks like
best solution for me actually.

Ups... yes... and there is no solution to delete it (expect from
disconnecting all clients from this file :-< )

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/
 
- you can rename the EXE
Ups... yes... and there is no solution to delete it (expect from
disconnecting all clients from this file :-< )

Actualy even the rename does not work always, now i found that. When i have
it open from my computer, i can rename. But once it gets opened from other
computers (and other users), it cannot be renamed anymore. So back to copy
to temp for me :(

Pete
 
Hi Peter Beno,
Actualy even the rename does not work always, now i found that. When i
have it open from my computer, i can rename. But once it gets opened
from other computers (and other users), it cannot be renamed anymore.
So back to copy to temp for me :(

Maybe you shoud ask a novell newsgroup...

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/
 
Actualy even the rename does not work always, now i found that. When i
Maybe you shoud ask a novell newsgroup...

So far i managed to track it down (though its still more just a guess), it
looks like when one is connected throught novell client it completely locks
file including renaming. I am connected from my computer throught windows
network emulation on novel (dont know what name that thing has) and that
does not seem to prevent renaming. Unfortunately plenty of other people here
in company use novell client. Oh well, at least now i know i can stop
troubling people on this group :)

Pete
 
Back
Top