Skip to content

Posts tagged ‘reboot’

28
Nov

Rebooting and Shutting Down via Command Prompt

When I originally found myself needing to reboot a machine via Remote Desktop, I realized that the shut down option was removed from the Start menu. Instead, I had the option to end my Remote Desktop session, nothing else. CTRL+ALT+DEL understandably didn’t work, as my local machine interpreted the key combination, not the remote machine. Without an obvious solution at the time, I remembered that there was a command line executable that could be used to shut down. The executable worked so well that I put batch file shortcuts on the desktop of the machine, allowing me to either restart or shut down the machine with a simple double-click. Seeing as this proved useful to me, I thought I would share how to do it.

To reboot the remote machine, simply use the following command in its Command Prompt.

shutdown /r /t:1 /y

There are three arguments being specified here: the first tells the shutdown executable that you want to reboot, not shut down. The second tells it to wait 1 second before shutting down, rather than the default 20 seconds. Finally, the third tells it to automatically answer “Yes” to any questions asked by the operating system when shutting down. The latter may speed up the operation, but you may lose any unsaved changes.

To shut down, simply use the following command:

shutdown /t:1 /y

That’s all there is to it. For more information about the shutdown comment, see this Microsoft Support article.

After using this approach for a month or so, I discovered that there was a way to use CTRL+ALT+DEL in Remote Desktop. Instead of CTRL+ALT+DEL, simply press CTRL+ALT+END, and the remote machine will behave as if it received a CTRL+ALT+DEL signal.

Sponsors
DiggRedditStumbleUponSlashdotShare
24
Jan

Using Ping to Monitor Reboots

When you`re rebooting a computer, and you need to know exactly when it is back online, try using this command:

ping -t <target>

<target> can be an IP or domain name.

This command will keep pinging the machine endlessly, which can reveal exactly when the computer is back on the network. As long as you keep getting “Request time out”, the machine isn’t online yet. When you get a reply, as illustrated below, you know you can connect to the machine.

Example output of ping -t shown in a Command Prompt window.

Example output of ping -t

Personally, I tend to put this window on my secondary monitor, while I continue working on the primary monitor.  As soon as the machine is online, I close the window or press CTRL+C to prevent the ping from going on endlessly. Be careful how you use this – some hosts can interpret endless pinging as an attack.

Thanks to François Deschênes for originally showing me this trick.

Sponsors
DiggRedditStumbleUponSlashdotShare