Click here to Skip to main content
15,900,816 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
ProcessStartInfo startinfo = new ProcessStartInfo("shutdown.exe", "-s");
Process.Start(startinfo)0;

its works only client side not server side when i hosted it then it not work
i shutdown the client system when they click shutdown button....
can it posssible
Posted
Comments
Sinisa Hajnal 7-Oct-14 4:50am    
You want to shutdown user (client) computer on button click?
Or enable the user to shut down your server?

Please try to explain a bit better. Thank you
Member 10285877 7-Oct-14 5:42am    
sir user computer

1 solution

Hi,

It will require username and password of server and you have to run the following command with rights of shutting down computer.

shutdown /[r|s] /m \\ComputerName /c "Comment" /d [u|p] <xx>:<yy>


you can get all options by using shutdown /? on cmd shell

Just format this command according to your needs and run this in C# by using ProcessStartInfo class.
 
Share this answer
 
Comments
Member 10285877 7-Oct-14 5:43am    
sir i want to shutdown the user computer button click

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900