Make Program Restart

  • Thread starter Thread starter scorpion53061
  • Start date Start date
S

scorpion53061

Is there a way that anyone knows to force a vb.net program to shut down
and then restart itself?
 
Perhaps one way is to write a windows service which checks for the existance
of the application and if it is not running, starts it, this way you only
have to close your application in order for it to restart.

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
If U Need My Email ,Ask Me

Time flies when you don't know what you're doing
 
Hi,

Use process.start to start a new instance of the program before you
kill the old instance.


Ken
 
Ok, I see what you are all saying. This is the problem.

Lets say I have a monitor in a program that downloads an update. It is a
self extracting exe file.

I need to shut down the program, send the update, and then restart the
program.

Has anyone does this before or something close to it?



________________________________

From: Ken Tucker [MVP] [mailto:[email protected]]
Sent: Saturday, August 28, 2004 4:11 PM
To: microsoft.public.dotnet.languages.vb
Subject: Re: Make Program Restart



Hi,

Use process.start to start a new instance of the program before you
kill the old instance.


Ken
 
You cant re-start a program from itself. You have to rely on another
process, so I think there are three things you need to do.

Have a service which is running permenently which does the following thing
each cycle.

Check a flag to see if program is to be run
If Yes, run a Bootstrap program

BootStrap
----------
Check for updates, install them if needed
Completes any other action determined by the flag file.
Starts the Main program


Main Program
--------------
Provide options for File | Exit , File | Restart

HTH








--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
If U Need My Email ,Ask Me

Time flies when you don't know what you're doing
 
Hi,

http://msdn.microsoft.com/msdnmag/issues/03/02/BITS/default.aspx

Ken
-----------------------
Ok, I see what you are all saying. This is the problem.

Lets say I have a monitor in a program that downloads an update. It is a
self extracting exe file.

I need to shut down the program, send the update, and then restart the
program.

Has anyone does this before or something close to it?



________________________________

From: Ken Tucker [MVP] [mailto:[email protected]]
Sent: Saturday, August 28, 2004 4:11 PM
To: microsoft.public.dotnet.languages.vb
Subject: Re: Make Program Restart



Hi,

Use process.start to start a new instance of the program before you
kill the old instance.


Ken
 

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

Back
Top