Bellow batch file shutdown remote laptops,
First it pings computer listed under computer.txt, and checks if computer is dead or alive.
if computer reachable, it will shutdown the computer in 0 second. And will print it into shutdown.txt file
for /f %%i in (C:\script\computers.txt) do call :Sub %%i
echo Testing %1
ping -n | find /i "bytes=" || set state=dead
echo %1 is %state% >> C:\script\shutdown.txt
if %state% == alive (
shutdown /m \\%1 /s /t 0
It was running perfectly and was shutting down remote PCs. After changing our antivirus to Webroot Antivirus, the script cause issue to the server. Under taskbar/Process, it creates a queue of (ping and cmd) one after another and I cause the virtual server memory to crash.
So is it my Script that cause the problem or the Antivirus cause issue?