
A friend from this site gave me a *.bat file which does the following:
1) pings specific ip addresses
2) If no active adress is scaned - except for the one of the server of course- then the pc sleeps
This is the bat file:
SETLOCAL
:LOOP
SET "_CNT=0"
FOR /L %%A IN (100,1,115) DO (
PING -n 2 192.168.1.%%A|FIND "TTL=">NUL && SET/A _CNT+=1)
IF %_CNT% EQU 1 rundll32.exe powrprof.dll,SetSuspendState 0,1,0
TIMEOUT /T 10 /NOBREAK>NUL
GOTO :LOOP
The problem is that when the pc wakes (e.g from a WOL app) the bat continues to run from the point that stopped. Is there any possibility to auto-re run the bat file from the begining? Maybe some added lines?
I am dos noob

Thanks