サーバーにロードされ、特定の時間に 52 台のデスクトップをシャットダウンできるバッチ ファイルを作成する方法を見つけようとしています。これが各コンピューターに対して実行されることを理解しています:
shutdown –m \\computername01 –s –f –c “The computer will restart, please save all work.” –t 60
shutdown –m \\computername02 –s –f –c “The computer will restart, please save all work.” –t 60
等...
ただし、タスクがスケジュールされているときに誰かがまだコンピューターを使用している場合に備えて、シャットダウンをキャンセルするオプションを提供できるようにしたいと考えています。
この作品のようなものでしょうか:
@echo off
echo Your PC will shutdown in 30 seconds! Press CTRL+C to abort.
ping -n 31 127.0.0.1>nul
shutdown –m \\computername01 –s –f –c “The computer will restart, please save all work.” –t 60
shutdown –m \\computername02 –s –f –c “The computer will restart, please save all work.” –t 60
または、次のようにする必要があります。
@echo off
echo Your PC will shutdown in 30 seconds! Press CTRL+C to abort.
ping -n 31 127.0.0.1>nul
shutdown –m \\computername01 –s –f –c “The computer will restart, please save all work.” –t 60
@echo off
echo Your PC will shutdown in 30 seconds! Press CTRL+C to abort.
ping -n 31 127.0.0.1>nul
shutdown –m \\computername02 –s –f –c “The computer will restart, please save all work.” –t 60
どんな助けでも素晴らしいでしょう!