I want to run an executable but delete it's source on disk while the exe is running. Details:
1) I have a computer with no hard drive that runs its Windows operating system totally from CD (i.e. BartPE)
2) I want to programmatically eject the CD and turn off the computer using eject.exe and turnoff.exe.
3) The above programs reside on the CD, so once the CD is ejected, the second program "turnoff.exe" cannot run.
A RAM disk is not an option for me because of the complexity and ugliness.
I made a single exe with Powerbasic but as soon as the CD ejects, the exe cannot complete the turnoff function.
Some have suggested UPX'ing the exe so that it will "run in memory", but my attempt to delete it from disk while running failed since a "handle" remained on it.
Here is C language source code that supposedly works: http://www.codeproject.com/KB/cs/Loa...oAssembly.aspx but my limited experience prevents me from translating it to Powerbasic.
There are many other uses for such an ability. An SFX installer could unpack itself without writing to disk, etc.
P.S. I just purchased the latest PB Win 9.0 and CC 5.0. What wonderful tools!
1) I have a computer with no hard drive that runs its Windows operating system totally from CD (i.e. BartPE)
2) I want to programmatically eject the CD and turn off the computer using eject.exe and turnoff.exe.
3) The above programs reside on the CD, so once the CD is ejected, the second program "turnoff.exe" cannot run.
A RAM disk is not an option for me because of the complexity and ugliness.
I made a single exe with Powerbasic but as soon as the CD ejects, the exe cannot complete the turnoff function.
Some have suggested UPX'ing the exe so that it will "run in memory", but my attempt to delete it from disk while running failed since a "handle" remained on it.
Here is C language source code that supposedly works: http://www.codeproject.com/KB/cs/Loa...oAssembly.aspx but my limited experience prevents me from translating it to Powerbasic.
There are many other uses for such an ability. An SFX installer could unpack itself without writing to disk, etc.
P.S. I just purchased the latest PB Win 9.0 and CC 5.0. What wonderful tools!
Comment