473,763 Members | 5,412 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to 'restart' application on exit?

mdb
Anyone have a suggestion for how to restart my appliacation when I exit?

I'm not talking about a looping batch file - I need my program to have the
ability to restart or not restart. Also, I can't just use Process.Start
because the program is a single-instance program, and I can't guarantee how
long the shutdown process will take (possibly a few seconds). I suppose I
could pass a parameter to the program in Process.Start to bypass the single
instance check, but I guess I'm looking for a more elegant solution, if it
exists...

-mdb
Jul 21 '05 #1
1 2074
Create a service, and start the exe if the exe isn't running. That way you
can stop the service if you ont want the app to restart.

--
Regards

John Timney
Microsoft Regional Director
Microsoft MVP

"mdb" <m_b_r_a_y@c_t_ i_u_s_a__d0t__c om> wrote in message
news:Xn******** *************** ****@207.46.248 .16...
Anyone have a suggestion for how to restart my appliacation when I exit?

I'm not talking about a looping batch file - I need my program to have the
ability to restart or not restart. Also, I can't just use Process.Start
because the program is a single-instance program, and I can't guarantee how long the shutdown process will take (possibly a few seconds). I suppose I
could pass a parameter to the program in Process.Start to bypass the single instance check, but I guess I'm looking for a more elegant solution, if it
exists...

-mdb

Jul 21 '05 #2

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

Similar topics

1
5238
by: aLvInDaHoUsE | last post by:
Hey all, help needed here. I'm trying to restart the program upon clicking on the logout button. How do I recall the main() function in the code? Thanks
5
11602
by: Jacek Jurkowski | last post by:
In a FMain of below application I'm throwing an Exception. It's catched by a catch section and application restarts. But in a reastarted application try section doesn't work no longer. Error throwed by FMain is no longer catched and causes a last chance CLR erception handler. Why? public static void Main(string pStartupParameters) { try
13
14493
by: TrintCSD | last post by:
How can I reset the collections within a foreach to be read as a change from within the foreach loop then restart the foreach after collections has been changed? foreach(string invoice in findListBox.listBox2.Items) { listBox2.Items count changed, restart this foreach } Thanks for any help.
0
1492
by: felecha | last post by:
Is there a way to write a Service so that it will fail? I'm working on a Service written in VB.Net, that supports an application we are building, and I want to make sure that it can restart itself. This is my first experience with it. In the Service Control Manager I know there are the options to say what to do if it fails, obviously I want to select Restart the Service. But how to test it? I can kill the Service there, but it does...
6
3807
by: Leonardo Curros | last post by:
Hello, I would like to know what's the best way to restart one service. I would like to do it from the service itself. Is this possible? I try it with ServiceController.stop() ServiceController.WaitForStatus(ServiceControllerStatus.Stopped) ServiceController.start() but doesn´t works. It seems waitforstatus instruction is the last
1
305
by: mdb | last post by:
Anyone have a suggestion for how to restart my appliacation when I exit? I'm not talking about a looping batch file - I need my program to have the ability to restart or not restart. Also, I can't just use Process.Start because the program is a single-instance program, and I can't guarantee how long the shutdown process will take (possibly a few seconds). I suppose I could pass a parameter to the program in Process.Start to bypass the...
8
9322
by: kenneth fleckenstein nielsen | last post by:
hi guru's I want to restart my webservice when ever it throws an exception that isn't cought. can i do that by web.config or iss or how ??
1
1935
by: Heikki Toivonen | last post by:
Is there any way to restart a Python (GUI) application that would work on Windows, Mac OS X and Linux? I'd like to provide a "restart" button to a dialog that would restart the application to pick new changes or start with different options. -- Heikki Toivonen
4
2174
by: =?Utf-8?B?bWFzbWl0aA==?= | last post by:
Can you restart an ASP.NET application in the Application_Start event when an error occurs so the next request for the application will fire the Application_Start event again? This would allow the application to recover without intervention if the problem is a database server is temporarily offline or other external source of data being loaded in the Application_Start event having a problem. I usually set up a SQL Dependency in the...
0
9563
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9997
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9937
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7366
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5270
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5405
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3917
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 we have to send another system
3
3522
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2793
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.