hi,
I want to run an exe during the machine shutdown. How can this be done?
Thanx
Printable View
hi,
I want to run an exe during the machine shutdown. How can this be done?
Thanx
I'd be surprised if you could.
Shutdown closes all active programs, and kills the processes...
rjlohan is correct. The answer to your question is, you can't.
I'm actually curious now, as to why you would actually want to do that?
This is a rather generic hack of a way but you could make a program with no interface that loads a form but doesn't show it. Then just leave it running so that the when windows shuts it down during its close up it'll fir the form's query unload event (and unload).
It won't work though, because the whole shutdown process is killing everything. Try it out, with notepad or something.
Actually I wanted to run a program which will determine for how much time was windows session going on. If I start the program in background and keep it running then there are lot of chances that the user will kill that application , so if i run this application of mine just before shut down then there is very rare chances of bypassing it as i want to kepp track of the time the user uses his machine (windows application)...
What do you mean try it out with notepad? How could I try that out with notepad?
It would work depending on how complex a thing you want to do at system close. I have a chat app that sends some finishing messages when it gets shut off, even when the system shuts it off. I think the system allows it so much time before it forces the shut off, there must be some timeout value.