Close & restart an application

  • Thread starter Thread starter CV
  • Start date Start date
C

CV

Hi,

I would like close & restart the same application automatically. How can I
achieve this.

Please suggest

Thanks & Regards
CV
 
CV said:
Hi,

I would like close & restart the same application automatically. How can I
achieve this.

Please suggest

Try this:

// shut down the current app instance

System.Windows.Forms.Application.Exit();

// restart the app

Process.Start(System.Windows.Forms.Application.ExecutablePath);
System.Windows.Forms.Application.DoEvents();
 

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