Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
:: Author: --removed--
:: Purpose: Performs mass shutdown for specified computers
:: Requirements: 1. Run this script with admin privileges
:: 2. Put the names of your computers, one per line, in "names" file in the same directory as this script
:: Version: 1.0 Initial write
:: Prep
:prep
@echo off
title Mass Shutdown
set NAMES_FILE=names.txt
set VERSION=1.0
set TIMER=120
set MESSAGE=Due to generator maintenance, this computer is shutting down in %TIMER% seconds. Save all work and log off immediately.
set TARGET=
cls
:: Menu
:shutdown
echo.
echo Mass Shutdown script - pretty awesome
echo.
echo Timeout: %TIMER%
echo Names File: %NAMES_FILE%
echo Message: %MESSAGE%
echo.
echo Enter one of the following:
echo - The IP or name of a computer to shutdown in %TIMER% seconds.
echo - 'all' to shutdown ALL computers in %NAMES_FILE%. You will be asked to confirm.
echo - 'abort' to cancel a pending shutdown.
echo - 'exit' to quit
echo.
:shutdown_loop
@set /P TARGET= Choice:
if '%TARGET%'=='all' goto shutdown_auto
if '%TARGET%'=='abort' goto shutdown_abort
if '%TARGET%'=='exit' goto end
:: else we assume a target was chosen
shutdown -s -f -m \\%TARGET% -t %TIMER% -c "%MESSAGE%"
set TARGET=
echo.
goto shutdown_loop
:: HIROSHIMA!
:shutdown_auto
title Mass Shutdown
cls
echo.
echo Verify information:
echo.
echo Timeout: %TIMER%
echo Target: %TARGET%
echo Names File: %NAMES_FILE%
echo Message: %MESSAGE%
echo.
echo Ready??
echo.
pause
echo Commencing...
echo.
echo Performing mass shutdown, %TIMER% second countdown.
echo Please wait...
echo.
FOR /F %%i in (%NAMES_FILE%) do shutdown -s -f -m \\%%i -t %TIMER% -c "%MESSAGE%"
goto shutdown
:shutdown_abort
title Abort a mass shutdown
:shutdown_abort_menu
cls
echo.
echo Enter one of the following:
echo - The IP or name of a computer to cancel a pending shutdown
echo - 'all' to cancel a pending mass shutdown.
echo - 'shutdown' to return to shutdown mode
echo - 'exit' to quit
echo.
:shutdown_abort_loop
@set /P TARGET= Choice:
if '%TARGET%'=='all' goto shutdown_abort_auto
if '%TARGET%'=='shutdown' goto prep
if '%TARGET%'=='exit' goto end
:: else we assume a target was chosen
shutdown -a -m \\%TARGET%
set TARGET=
echo.
goto shutdown_abort_loop
:shutdown_abort_auto
FOR /F %%i in (%NAMES_FILE%) do shutdown -a -m \\%%i
goto end
:end
title %USERNAME%