473,385 Members | 2,044 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,385 software developers and data experts.

Programmatically Reboot Computer Using C#

Dex
Hello,
We're developing our own small installation application in C#. At the end
of the installation, we need to reboot the computer. Does anyone know how
to write some C# code to programmatically reboot the computer? (Note: The
computer will be Win2k, WinXP, or Win2k3, nothing else.)
Thanks.
Nov 16 '05 #1
1 5118
search MSDN for "System Shutdown Functions"
I would suggest interop + 'InitiateSystemShutdown'

"Dex" <de*@nospam.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Hello,
We're developing our own small installation application in C#. At the end
of the installation, we need to reboot the computer. Does anyone know how
to write some C# code to programmatically reboot the computer? (Note: The
computer will be Win2k, WinXP, or Win2k3, nothing else.)
Thanks.

Nov 16 '05 #2

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

Similar topics

2
by: John Spiegel | last post by:
Hi all, Is there a way to programmatically restart Windows (2000, specifically), login automatically then start an application? I've been running across some Windows Shell options (which...
2
by: MarkZ2001 | last post by:
Hello: I'd like to set mouse and display settings programmatically without having to log out or restart. Is this possible by making registry settings and then having the winlogin process...
0
by: Loretta | last post by:
I have been trying to install VB.net 2002 and keep getting the following error: "Setup has detected that another program requires the computer to reboot. You must reboot the computer before...
1
by: Aaron | last post by:
Not sure if this is the best spot to post this question, but I am not going to pay money to ask an installation question.... Anyways I am trying to install C# standard 2003 and it analyzes the...
8
by: Avi G | last post by:
Hi, what is the quick code in C# for reboot local machine? Thanks.
2
by: =?Utf-8?B?Qm9ybjJTYWls?= | last post by:
A security update was automatically received the week of 6/11/07 requiring my computer to reboot automatically. When it restarted, Windows would not reboot. I have tried to remedy the problem...
3
by: cj | last post by:
My program shuts itself down and reboots the pc it's running on at 2:00am twice a week and has been doing so without fail for over a year. But twice in the past month it's been found running in the...
3
by: Kate77 | last post by:
Hello, I have a strange problem, I have application running in the tray bar, for some reason I cant reboot the computer when it is running and i have to close it if i want the computer to do a...
8
by: K Viltersten | last post by:
I've found a number of pages describing how to restart the computer that my service runs on. The nicest one was the Black Wasp's but even there, i need to play with C++-like looking code. Is it...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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,...
0
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...

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.