Remote Shutdown and Processes
-
Good day to all, Currently im developing an administrative tool that allows me to monitor all workstation under my domain. I want to do remote shutdown/restart/log-off using C#. At first I was thinking of executing the ff: shutdown -r -f -m \\pcname -t 0 for restart.. shutdown -s -f -m \\pcname -t 0 for shutdown.. I planned to execute it under C# Process & ProcessStartInfo however i feel i doesnt much have control because whenever i shutdown/restart an offline pc, if it is on command line, then it will just hang-up or just a cursor blinking and will not exit the command (maybe it would take too long..). I hope somebody could help me find a way to execute shutdown/restart/log-off remotely which we have better control and more reliable way. Also also want to get remotely,the processes that runs under the client machine/workstation, i hope this is feasible in C#. Im using .NET 2003 environment, thanks a lot, -- modified at 2:39 Friday 17th March, 2006
-
Good day to all, Currently im developing an administrative tool that allows me to monitor all workstation under my domain. I want to do remote shutdown/restart/log-off using C#. At first I was thinking of executing the ff: shutdown -r -f -m \\pcname -t 0 for restart.. shutdown -s -f -m \\pcname -t 0 for shutdown.. I planned to execute it under C# Process & ProcessStartInfo however i feel i doesnt much have control because whenever i shutdown/restart an offline pc, if it is on command line, then it will just hang-up or just a cursor blinking and will not exit the command (maybe it would take too long..). I hope somebody could help me find a way to execute shutdown/restart/log-off remotely which we have better control and more reliable way. Also also want to get remotely,the processes that runs under the client machine/workstation, i hope this is feasible in C#. Im using .NET 2003 environment, thanks a lot, -- modified at 2:39 Friday 17th March, 2006
-
Try this : string t = "-r -c \"I am going to reboot your mechine\" -t 20"; Process process = new Process(); process.StartInfo.FileName = "shutdown.exe "; process.StartInfo.Arguments = t; process.Start(); I think this will solve your problem. Cheers Jijo