Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old August 11th, 2006, 08:06 AM
Authorized User
Join Date: May 2006
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Restart computer using c#


           Can any one help me how to restart the computer using c# or vb.net.

Old August 11th, 2006, 10:49 AM
2V. 2V. is offline
Authorized User
Join Date: Aug 2006
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts

try something like:
System.Diagnostics.Process.Start("Shutdown", "-s -t 10")
you can see detail making a comand shutdown /? in Windows Command Line

Old October 20th, 2006, 04:29 AM
Registered User
Join Date: Oct 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to shriji.1111

I found this in www.codeguru.com site so,
please check there if you don't found there give me a message i try over there.
that's nice problem.

Brijesh Shah
Old January 5th, 2015, 05:23 AM
Registered User
Join Date: Apr 2014
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts

using System.Diagnostics;
using System.Runtime.InteropServices;
Process.Start("shutdown", "/r /t 0"); // the argument /r is to restart the computer
thuê máy chủ

Last edited by congpho; June 14th, 2015 at 10:28 PM..

Similar Threads
Thread Thread Starter Forum Replies Last Post
restart windows surendran SQL Server DTS 1 January 11th, 2007 12:25 AM
Tomcat: restart only one application wakeup Servlets 1 March 30th, 2006 05:15 AM
restart mysql crmpicco MySQL 1 September 13th, 2005 04:34 AM
Restart an application aldwinenriquez General .NET 0 August 16th, 2005 07:14 PM
restart crmpicco SQL Language 1 February 7th, 2005 11:21 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.