通信経路にあるPCをshutdownする場合のコマンドについて調べた。
自PCのshutdownと合わせて記載する。
自PCでのshutdown
Windows
> shutdown -s -t 0
linux
自分がよく使うのは以下。
$ sudo shutdown -h now
他PCからのshutdown
Windows
Remote shutting down computer over WiFi with cmd
設定をしてから以下を実行する。
> shutdown -m \\mypcname -r -c "this pc will shutdown in 60 secs" -t 60
デフォルト設定ではないため、設定変更する場合と、自作shutdownソフトを走らせる場合の利点、欠点は検討を要する。
OSの機能として用意されているというのは1ポイント。
どのバージョンのWindows(7, 8.1, 10?)で有効かは未消化。
linux
sshとsudoの組合せ
$ ssh user@remote_computer sudo poweroff
上記の例ではshutdown -h now
の代わりにpoweroff
を使用。