Why re-invent the wheel? So to speak. :)

http://dimio.altervista.org/eng/


Benj





On May 22, 5:41 am, "[email protected]"
<[email protected]> wrote:
> Hi all,
>
> I am developing a c# application that will enable users to perform a
> remote shutdown on computers. I have got the code working to a degree.
> I am able to run shutdown -r -t 50. and my computer shutsdown fine. If
> i try
> shutdown -m \\computer_name -r -t 50 the command prompt window opens
> and closes but nothin happens. computer_name is the name of my local
> computer. I can enter the command directly into the command prompt and
> my computer shutsdown fine without any problems.
>
> Below is the code that I have
>
> Process p = new Process();
>                     p.StartInfo.FileName = "shutdown";
>                     p.StartInfo.UseShellExecute = false;
>                     p.StartInfo.CreateNoWindow = false;
>                     p.StartInfo.Arguments = "-r -t 50 -m \\dell_pc";
>                     //p.StartInfo.Arguments = "-A";
>                     p.StartInfo.RedirectStandardOutput = true;
>                     p.Start();
>                     Console.WriteLine(p.StandardOutput.ReadToEnd());
>
> This code is within a try/catch. And no errrors are thrown
>
> Any help in this matter would be highly appreciated.
>
> Thank you

Reply via email to