runassrv add /cmdline:"c:\1.bat" /type:interactiveprocess /priority:AboveNormal /name:testsrv /logfile:C:\test.log /loglevel:debugonly /dispname:"My Test Service" /desc:"This is a Test Service"
1.bat
@echo off
@copy nul Server.ip.txt
@for /L %%A in (1,1,1) do ping -n 1 -l 16 -w 100 192.168.0.%%A | find "Reply" >> Server.IP.txt