This article will describe how to shutdown remote network computers by using a small batch script to loop into each hostname/ip line within a text file and issuing the shutdown command to the computer(s).
The above code will take an argument for the shutdown time which we specify while running the script:
@echo off
if “%1″==”" goto fin
for /f “tokens=1″ %%i in (computers.txt) do ^
shutdown -s -t %1 -f -m \\%%i
:fin
Explaining the above code we first check if an argument exist so it continues with the batch file else it ends.
For each hostname/ip inside the computers.txt it executes the shutdown command for each remote machine inside the network.
We could even simplify the script without asking for any arguments with the following snippet:
@echo off
for /f “tokens=1″ %%i in (computers.txt) do ^
shutdown -s -t 30 -f -m \\%%i
The -t 30 is for the time limit which by default is 30 if you do not specify that option.
The -s option shutdown the computer.
The -f option forces the application to close while the system shutdown without asking the user to interact.
The -m option is to specify the computer(s) hostname/ip.
After we finish with the batch file we can schedule it to run through a domain admin account to remotely shutdown the network computer(s) at specific times and dates.



















































drcliff






May 9, 2009
Please solve my problem from .bat file. i want to shutdown system through login that the person login from specific login id on local machine and after login script runs and system shutdown i want these two on Windows Server 2003 and Windows XP.
[Reply]
December 16, 2009
i want u to tell me with out any autentication i want to shutdown remotely using scripts like vbs please help me out
[Reply]