473,326 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

How do I wait for a task to finish and then initiate a reboot???

I have a very small console taks that i perform at the very beginning of
running my app for the first time.
I want to be able to wait until this Process is finished and then initiate a
reboot of the machine.

Does anyone have a code snippet that could accomplish this?
Nov 20 '05 #1
2 1198
1) You can wait for a process to finish using the WaitForExit method
(http://msdn.microsoft.com/library/en...mdiagnosticspr
ocessclasswaitforexittopic.asp)

2) I'm not aware of a function in the .NET Framework to reboot a machine,
but you could use the command RESTART -R

--
Greetz,
Jan
__________________________________
Read my weblog: http://weblogs.asp.net/jan
"Aaron Ackerman" <no@spam.com> schreef in bericht
news:%2****************@TK2MSFTNGP12.phx.gbl...
I have a very small console taks that i perform at the very beginning of
running my app for the first time.
I want to be able to wait until this Process is finished and then initiate a reboot of the machine.

Does anyone have a code snippet that could accomplish this?

Nov 20 '05 #2
* "Aaron Ackerman" <no@spam.com> scripsit:
I have a very small console taks that i perform at the very beginning of
running my app for the first time.
I want to be able to wait until this Process is finished
'Process.WaitForExit' (see MSDN).
and then initiate a
reboot of the machine.


<http://www.mentalis.org/soft/class.qpx?id=7>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #3

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

Similar topics

5
by: PontiMax | last post by:
Hi, when I press the OK button of my dialog box a long-running task is initiated. Therefore I would like to make visible a div section right after clicking the button where a user-friendly...
4
by: Prasad | last post by:
Hello, I have two threads T1 and T2. T2 starts thread T1 and waits for 1 minute for T1 to finish (using Join) and if it doesn't finish within that time, it aborts the thread T1. Now, I...
18
by: Coder | last post by:
Howdy everybody! How do I do the following... while (myVary != true){}; Obviously I do not want to use 100% of the processor to stay in this infinite loop till myVar == true. But wait do I...
7
by: DFS | last post by:
Before I build my own custom system, I wondered if anyone here has created or knows of some commercial systems (say for construction cost/time estimating) that help manage projects where some Task...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.