Replacing the file from which the code is executed

H

hoenes1

Hi all,

how can I replace the file I'm executing at the moment? I want Windows
to end the process, perform the copy/update action and then restart
the new file. Are there any handy mechanisms?

Thanks in advance.
 
J

Jochen Kalmbach

Hi hoenes1,
how can I replace the file I'm executing at the moment? I want Windows
to end the process, perform the copy/update action and then restart
the new file. Are there any handy mechanisms?

- start a second app
- terminate your app
- replace the exe in your second app
- start the app again
- terminate second app

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/
 
J

Jochen Kalmbach

Hi hoenes1,
how can I replace the file I'm executing at the moment? I want Windows
to end the process, perform the copy/update action and then restart
the new file. Are there any handy mechanisms?

An other solution is to rename your EXE (this is possible) and then write
the new exe and start the exe and terminate.
--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/
 
H

hoenes1

Jochen Kalmbach said:
Hi hoenes1,


An other solution is to rename your EXE (this is possible) and then write
the new exe and start the exe and terminate.

Jochen,

thank you for your proposals. These were the techniques I would think
of, too. I thought there could be a special Windows way, but your
proposals are ok for me. Thanks again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top