Shutdown command
Guys
I'm failing to understand the shutdown syntax. shutdown /r works but shutdown /r /p does not work
I need to use /p to force an immediate shutdown and avoid the default 1-minute wait
Thanks
August 21st, 2011 11:41am
shutdown /r
Restarts the computer after shutdown.
shutdown /p you can use /p only with /d or
/f
Turns off the local computer only (not a remote computer)—with no time-out period or warning. You can use
/p only with /d or /f. If your computer does not support power-off functionality, it will shut down when you use
/p, but the power to the computer will remain on.
http://technet.microsoft.com/en-us/library/cc732503(WS.10).aspx
http://www.virmansec.com/blogs/skhairuddin
Free Windows Admin Tool Kit Click here and download it now
August 21st, 2011 12:57pm
Hi,
Try to use shutdown /p instead of shutdown /r /p.
Best Regards,
Vincent Hu
August 21st, 2011 1:00pm
Hi,
You can try "shutdown -r -t 01" command this will restart in 1 second.
Free Windows Admin Tool Kit Click here and download it now
August 21st, 2011 1:11pm
To force an 'immediate' reboot, enter
shutdown /r /t 1[string](0..9|%{[char][int](32+("39826578840055658268").substring(($_*2),2))})-replace "\s{1}\b"
August 21st, 2011 2:21pm
Thanks guys - it's been a while. I entered shutdown /r /t 1 into a text file and called it reboot.bat. However,
it goes into a loop and doesn't actually do anything
Do I use exit or end on the 2nd line? I want the batch file to close and simply reboot the computer
Thanks
Free Windows Admin Tool Kit Click here and download it now
August 21st, 2011 3:11pm
Does it work from the command line?
The command, I mean, not the batch file.
[string](0..9|%{[char][int](32+("39826578840055658268").substring(($_*2),2))})-replace "\s{1}\b"
August 21st, 2011 3:16pm
Yes it works fine directly from the command line. In a bath file, both exit and end don't work. As soon as i open the batch file, it opens a command window and enters the shutdown command which goes in a constant loop
Free Windows Admin Tool Kit Click here and download it now
August 21st, 2011 3:37pm
Try this:
Shutdown /f /r /t 00
It will forcefully restart the computer in 0 seconds.
If you found this post helpful, please give it a "Helpful" vote. If it answered your question, remember to mark it as an "Answer".
Rich Prescott | MCITP, MCTS, MCP
Blog | Twitter:
@Arposh |
Powershell Client System Administration tool
August 21st, 2011 4:51pm
Use Sysinternal
PsShutdown tool.
By using power shell:
$server = gwmi Win32_operatingsystem -computer Your_Servername
$server.reboot()
Post your query in scripting forum.
http://social.technet.microsoft.com/Forums/en-US/ITCG/threads
Thanks
Free Windows Admin Tool Kit Click here and download it now
August 21st, 2011 11:21pm
By using power shell:
$server = gwmi Win32_operatingsystem -computer Your_Servername
$server.reboot()
Or,
Restart-Computer -Computername $server
Or,
(gwmi -class win32_operatingsystem -cn $server).reboot()
[string](0..9|%{[char][int](32+("39826578840055658268").substring(($_*2),2))})-replace "\s{1}\b"
August 22nd, 2011 2:16am
1. When I use finction like shutdown, I look into help by "sutdown /?". It gives the info abou allowable combination of parameters.
2. Shutdown with the "-s -f - m \\ip-address - t 0" parameters gives some advantages when you need to shutdown remote computers that in "normal" case the AV program prevents from shutdowning (or even logoff the computer) because of AV settings (when CD or
FDD are in computer). Remote execution of batch file containing shutdown -s -f -m \\ip -t 0 ends the AV program sooner than AV program prevents computer from shutdown.
Free Windows Admin Tool Kit Click here and download it now
August 22nd, 2011 4:46am


