I'm trying to shutdown PC remotely programmatically using c# via command prompt and I already done a few search and found out this kind of codes.
System.Diagnostics.Process.Start("shutdown", "/s");
And since it doesn't spicify any pc which to shutdown so I tried changing that codes to this codes which I think satisfy my goal. But it turns out that this doesn't work.
System.Diagnostics.Process.Start("shutdown", "/s /m \\192.168.1.21 /t 5 /c 'Shutdown in 5 seconds'");
NO Exception in C# it just don't shutdown.
I also try this but no luck.
System.Diagnostics.Process.Start("shutdown /s /m \\192.168.1.21 /t 5 /c 'Shutdown in 5 seconds'");
C# Exception "The system cannot find file specified".
EDIT:
I forgot to tell you that I alredy set up my remote computer and server the way that it will not fail to connect to each other such as turning off the firewall, configuring Local system policy and changing network and sharing center.