473,513 Members | 2,477 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Replacing the file from which the code is executed

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.
Nov 17 '05 #1
3 810
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/
Nov 17 '05 #2
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/
Nov 17 '05 #3
Jochen Kalmbach <no********************@holzma.de> wrote in message news:<Xn*********************************@127.0.0. 1>...
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.


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.
Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3589
by: middletree | last post by:
I have a page which, according to the boss's instructions, needs to show one of two things, based on which radio button was chosen on the previous page. Because these 'things' are actually some...
13
2283
by: Joseph Oget | last post by:
If I use the code below in a VB.NET form, even if the file exists, and is then executed, the Else statement produces the "Sorry cannot find the File " error message. The MessageBox.Show(...
12
2578
by: anonymous | last post by:
Hello, I need to replace this char  with another char. However I am not able to acieve this. I tried this but it doesnt work: str = str.Replace(chr(asc(194)), "") Can somebody help ?
7
2570
by: Ryan Taylor | last post by:
Hi. I have some code that dynamically generates a PDF and spits this content directly to the web browser. I use HTMLDoc to create the Pdf's from html. So the user can click on a button "Print...
12
5836
by: Adam J. Schaff | last post by:
I am writing a quick program to edit a binary file that contains file paths (amongst other things). If I look at the files in notepad, they look like: ...
17
2676
by: spentun | last post by:
How can I moitor file which is executed by user or program in window. I need to write a code to monitor file. When user clicks the file(.exe) or is called by program, the name of file will be...
32
3847
by: FireHead | last post by:
Hello C World & Fanatics I am trying replace fgets and provide a equavivalant function of BufferedInputReader::readLine. I am calling this readLine function as get_Stream. In the line 4 where...
7
3498
by: aine_canby | last post by:
Hi, Im totally new to Python so please bare with me. Data is entered into my program using the folling code - str = raw_input(command) words = str.split() for word in words:
1
1029
by: Thomas 'PointedEars' Lahn | last post by:
Gregor Kofler wrote: I am curious, why did you choose to use a factory instead of a constructor? It's a closure and `privateVar' in privateFunc() is bound to the execution context of foo(),...
0
7260
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7162
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7384
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7101
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7527
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5686
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3234
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1597
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
456
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.