1.

Solve : Batch File Reboot IP Range?

Answer»

I am a bit rusty on BATCH files so am CURIOUS if anyone else has some IDEA's. I have a batch file that reboots all remote workstations that are listed in a text document (computers.txt). The problem is the text document carries all computer names, is there a WAY I could just have it restart all workstations within a set IP range? Below is the batch file I am using.

@echo off
FOR /F %%i IN (computers.txt) DO call:sd %%i
goto:eof

:sd
ping -n 1 %* >nul || ping -n 4 %* >nul
if not errorlevel 1 shutdown -m \\%* -f -r -t 30 -c "NETWORK maintenance is being performed. System shutdown will begin in 30 seconds. Please save any open files and logoff."The first problem I see is your shutdown comment. If they log off, then I'm fairly sure it won't shutdown.



Discussion

No Comment Found