473,802 Members | 2,172 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Programmaticall y 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 programmaticall y reboot the computer? (Note: The
computer will be Win2k, WinXP, or Win2k3, nothing else.)
Thanks.
Nov 16 '05 #1
1 5179
search MSDN for "System Shutdown Functions"
I would suggest interop + 'InitiateSystem Shutdown'

"Dex" <de*@nospam.com > wrote in message
news:%2******** ********@TK2MSF TNGP14.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 programmaticall y 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
3452
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 further examples would be appreciated) but would particularly like to find a .NET-specific example. TIA, John
2
4128
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 re-read the registry? Or is there another way to do this? I will likely need to capture multiple settings from a host computer and put them into effect on a target machine. Thanks.
0
227
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 installing Visual Basic .NET Windows Component Update. Once the system reboots, you need to restart setup. Click OK to reboot. Click cancel to exit setup and install later." I reboot and get the same error. I have tried to shut down my IIS and...
1
1572
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 system and then say I need to install some prerequisite stuff. So I click on the link that says that and then I get a message the that some application is already requesting a reboot. This is a brand new Compaq laptop purchased yesterday. I have...
8
8315
by: Avi G | last post by:
Hi, what is the quick code in C# for reboot local machine? Thanks.
2
1341
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 via F8 and using the debug and restore options there. What I get is DOS scroll thru a list of drivers that ends at: multi(0)rdisk(0)partition(1)\WINDOWS\system32\drivers\btkrnl.sys BTW, my computer is used in a risk-free manner. I have virus...
3
1700
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 AM with an unhandled exception on the screen. As best I can tell this exception occurs while it's trying to reboot the pc. This has me thinking it might be nice to have it do a reboot whenever it has an unhandled exception but then again I'm...
3
1480
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 reboot or shutdown. the application is not doing anything special, all it does is checking a web site every hour using timer. anyone saw this problem or know how to get over it so users can shutdown the computer even when the application is...
8
2427
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 really neccessary? http://www.blackwasp.co.uk/ExitLogoffWindows.aspx I'd like to believe that there's at least a convenience wrapper for performing such task
0
9562
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10536
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10304
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...
0
10063
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6838
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5494
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
5622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3792
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2966
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.