Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Shutdown another System using shutdown.exe in C#?

I use the following code for shutdown the own System.It was working Fine.And I need to shut down another System, which is connected in LAN Connection. I'm unable to do it with this code. How to Shutdown another System using shutdown.exe? My OS is windows7.

using System.Diagnostics;


        protected void Button1_Click(object sender, EventArgs e)
        {
            Process.Start("shutdown.exe", "-s -t 00");

        }
like image 586
V.V Avatar asked Nov 23 '12 05:11

V.V


People also ask

How can I shutdown one computer from another computer?

Press Windows key + R on the keyboard to open the Run dialog. Type shutdown /i command and click the OK button. Click the Add button. Enter the computer name or IP address of the remote computer.

How do you shutdown all computers on a network using CMD?

Shut down machines remotely from any computer on the network by clicking the Start button in the lower-left corner of your screen, selecting "All Programs," "Accessories" and then "Command Prompt." Type "shutdown /i" (without the quotes) and press "Enter" to open the remote shutdown dialog box.


1 Answers

Menu Start->Run->type cmd-> press enter

in cmd type

shutdown /?

You can see help, according to help the key you need is

   /m \\computer Specify the target computer.
like image 110
Alex Veremeenko Avatar answered Sep 27 '22 22:09

Alex Veremeenko