V.V
V.V

Reputation: 883

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");

        }

Upvotes: 7

Views: 1140

Answers (2)

looper
looper

Reputation: 1989

Just for completeness:

Process.Start("shutdown.exe", "-s -t 00 \\computer");

Upvotes: 1

Alex Veremeenko
Alex Veremeenko

Reputation: 356

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.

Upvotes: 1

Related Questions