shutdown.exe (Question)

Please support our C# advertiser: Intel Parallel Studio Home
Reply

Join Date: Jul 2005
Posts: 1,542
Reputation: tayspen is on a distinguished road 
Solved Threads: 98
Team Colleague
tayspen's Avatar
tayspen tayspen is offline Offline
<Insert title here>

shutdown.exe (Question)

 
0
  #1
Aug 21st, 2005
If i were tto implement somthing like this

cmd \k shutdown.exe -r

on a button click would that saftley restart y comp. from that app. if not how would i do this
Firefox
Ewido
Tune up windows
Get detailed system information
My Fixes

Member - Alliance of Security Analysis Professionals - Since 2006
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 1,542
Reputation: tayspen is on a distinguished road 
Solved Threads: 98
Team Colleague
tayspen's Avatar
tayspen tayspen is offline Offline
<Insert title here>

Re: shutdown.exe (Question)

 
0
  #2
Aug 22nd, 2005
google is letting me down
Firefox
Ewido
Tune up windows
Get detailed system information
My Fixes

Member - Alliance of Security Analysis Professionals - Since 2006
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 206
Reputation: plazmo is an unknown quantity at this point 
Solved Threads: 16
plazmo's Avatar
plazmo plazmo is offline Offline
Posting Whiz in Training

Re: shutdown.exe (Question)

 
0
  #3
Aug 27th, 2005
try this:


  1.  
  2. using System.Diagnostics;
  3.  
  4. ProcessStartInfo startinfo = new ProcessStartInfo("shutdown.exe","-r");
  5. Process.Start(startinfo);
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 1,542
Reputation: tayspen is on a distinguished road 
Solved Threads: 98
Team Colleague
tayspen's Avatar
tayspen tayspen is offline Offline
<Insert title here>

Re: shutdown.exe (Question)

 
0
  #4
Aug 27th, 2005
Originally Posted by plazmo
try this:


  1.  
  2. using System.Diagnostics;
  3.  
  4. ProcessStartInfo startinfo = new ProcessStartInfo("shutdown.exe","-r");
  5. Process.Start(startinfo);

hmmm the r stands for restart so is l logoff?
Firefox
Ewido
Tune up windows
Get detailed system information
My Fixes

Member - Alliance of Security Analysis Professionals - Since 2006
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 206
Reputation: plazmo is an unknown quantity at this point 
Solved Threads: 16
plazmo's Avatar
plazmo plazmo is offline Offline
Posting Whiz in Training

Re: shutdown.exe (Question)

 
0
  #5
Aug 27th, 2005
  1.  
  2. -i Display GUI interface, must be the first option
  3. -l Log off (cannot be used with -m option)
  4. -s Shutdown the computer
  5. -r Shutdown and restart the computer
  6. -a Abort a system shutdown
  7. -m \\computername Remote computer to shutdown/restart/abort
  8. -t xx Set timeout for shutdown to xx seconds
  9. -c "comment" Shutdown comment (maximum of 127 characters)
  10. -f Forces running applications to close without war
  11. ning
  12. -d [u][p]:xx:yy The reason code for the shutdown
  13. u is the user code
  14. p is a planned shutdown code
  15. xx is the major reason code (positive integer le
  16. ss than 256)
  17. yy is the minor reason code (positive integer le
  18. ss than 65536)

-l would be logoff
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 1,542
Reputation: tayspen is on a distinguished road 
Solved Threads: 98
Team Colleague
tayspen's Avatar
tayspen tayspen is offline Offline
<Insert title here>

Re: shutdown.exe (Question)

 
0
  #6
Aug 27th, 2005
Tahnk you and is thissafe for the computer?
Firefox
Ewido
Tune up windows
Get detailed system information
My Fixes

Member - Alliance of Security Analysis Professionals - Since 2006
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 206
Reputation: plazmo is an unknown quantity at this point 
Solved Threads: 16
plazmo's Avatar
plazmo plazmo is offline Offline
Posting Whiz in Training

Re: shutdown.exe (Question)

 
0
  #7
Aug 27th, 2005
yeah its safe, its no different then going to cmd and using it
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 1,542
Reputation: tayspen is on a distinguished road 
Solved Threads: 98
Team Colleague
tayspen's Avatar
tayspen tayspen is offline Offline
<Insert title here>

Re: shutdown.exe (Question)

 
0
  #8
Aug 27th, 2005
Originally Posted by plazmo
yeah its safe, its no different then going to cmd and using it

lol ok thanks so i guess its safe there
Firefox
Ewido
Tune up windows
Get detailed system information
My Fixes

Member - Alliance of Security Analysis Professionals - Since 2006
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 2
Reputation: j4nu5 is an unknown quantity at this point 
Solved Threads: 0
j4nu5 j4nu5 is offline Offline
Newbie Poster

Re: shutdown.exe (Question)

 
0
  #9
Mar 3rd, 2008
Originally Posted by plazmo View Post
  1.  
  2. -i Display GUI interface, must be the first option
  3. -l Log off (cannot be used with -m option)
  4. -s Shutdown the computer
  5. -r Shutdown and restart the computer
  6. -a Abort a system shutdown
  7. -m \\computername Remote computer to shutdown/restart/abort
  8. -t xx Set timeout for shutdown to xx seconds
  9. -c "comment" Shutdown comment (maximum of 127 characters)
  10. -f Forces running applications to close without war
  11. ning
  12. -d [u][p]:xx:yy The reason code for the shutdown
  13. u is the user code
  14. p is a planned shutdown code
  15. xx is the major reason code (positive integer le
  16. ss than 256)
  17. yy is the minor reason code (positive integer le
  18. ss than 65536)

-l would be logoff
I had an idea for a program and saw this. Thank you for the advice, it really helped; however, I am not sure how to implement it all...

... when using the following commands, what is the correct way to input it?

following the example code given earlier, I typed:
ProcessStartInfo startInfo = new ProcessStartInfo("shutdown.exe", "-m \\COMPUTERNAME");

upon clicking the button this code was written for, nothing happened on the computer I was trying to shut down, though (unfortunately) my computer restarted after approximately 30 seconds. I don't think I input it correctly, or I was attempting to do something -m wasn't meant to do?

Also, when I typed "-t 10" (wanting the computer to shut down 10 seconds after the button was clicked, nothing happened.

Wat am I doing wrong?
Thanks for the help
j4nu5
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 1
Reputation: Groblin is an unknown quantity at this point 
Solved Threads: 0
Groblin Groblin is offline Offline
Newbie Poster

Re: shutdown.exe (Question)

 
0
  #10
Mar 5th, 2008
But why you use shutdown.exe?

There are API functions: ExitWindows, ExitWindowsEx, InitiateSystemShutdown, InitiateSystemShutdownEx. Try this.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C# Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC