How to Shut Down and Reboot Remote PCs via the Command Prompt

1] use remote desktop connection

Remote Desktop Connection, a tool built into Windows 10/8/7, so no need to download anything else. RDP (Remote Desktop Protocol) is a proprietary tool from Microsoft that allows remote access to a computer.

4] using free shutter tool

Of course, we would talk about Shutter since we’ve recently reviewed it. It’s a great tool for scheduling events, but it is also perfect for restarting your computer from a remote location, or via the internet in layman terms.

Remotely start or stop service from cmd

Shutdown command examples

To bring this all together, let’s go over a few examples. First, let’s say that you are connected to your office PC via Remote Desktop and you want to reboot it immediately. You know that no one else is using it and all of your documents and data are saved. While in the Remote Desktop session, launch Command Prompt on your office PC and type the following command:

shutdown -r -f -t 0

That command will reboot the computer (-r), force all applications to close so that one doesn’t get stuck and prevent the reboot from happening (-f), and it will happen immediately with a zero second delay (-t 0). In this case, we’re accessing the Command Prompt via Remote Desktop directly on the office PC, so we don’t need to specify the computer name with the -m parameter because we are, in effect, operating on the local machine, even though we’re not sitting in front of it.

Here’s a second example: you work from home with your spouse, but have different offices in the house. In your office, you need to shut down your spouse’s computer (computer name “UPSTAIRS”) because a lightning storm is rolling in and you want to be on the safe side.

shutdown -s -f -m UPSTAIRS -t 60 -c "Shutting down for storm. Save work and close apps."

This command shuts down the computer (-s), forces running applications to close (-f), designates the remote PC by name (-m UPSTAIRS) because you’re executing the command on your own PC, gives a time delay of 60 seconds (-t 60), and provides a descriptive message (-c) that will appear on your spouse’s computer to notify them of the impending shutdown.

:/>  Как найти в компьютере калькулятор 🚩 как сделать калькулятор в компьютере 🚩 Программное обеспечение

Simplest way to restart service on a remote computer

There will be so many instances where the service will go in to “stop pending”.The Operating system will complain that it was “Not able to stop the service xyz.” In case you want to make absolutely sure the service is restarted you should kill the process instead. You can do that by doing the following in a bat file

taskkill /F /IM processname.exe
timeout 20
sc start servicename

To find out which process is associated with your service, go to task manager–> Services tab–>Right Click on your Service–> Go to process.

Note that this should be a work around until you figure out why your service had to be restarted in the first place. You should look for memory leaks, infinite loops and other such conditions for your service to have become unresponsive.

Как немедленноо перезагрузить или выключить компьютер из командной строки

Для безотлагательного выключения компьютера используйте:

shutdown /s /t 0

Для немедленной перезагрузки компьютера используйте:

shutdown /r /t 0

Команда shutdown для выключения, перезагрузки или гибернации

Для выключения, перезагрузки или гибернации с помощью командной строки используется команда shutdown. Основной список параметров:

Примеры использования утилиты shutdown

Если запустить утилиту shutdown с параметром /i, то на эране увидите примерно следующее (актуально для Windows 7):

При использовании отложенной перезагрузки:

shutdown /r /t 180

Получим следующее уведомление на экране:

Если вы желаете отменить намеченную перезагрузку, то используйте команду:

shutdown /а

В области уведомлений возле часов вы должны увидеть примерно следующее:

Оставьте комментарий