REM run.bat starts here.
@ECHO OFF
del namelist.txt
del netview.txt
net view > netview.txt
@for /f "tokens=1" %%a in (netview.txt) do checkbox.bat %%a
echo .
echo Done
REM run.bat ends here.
REM CheckBox.bat starts here.
@ECHO OFF
if "%1" == "" goto ErrorInParm
echo Checking %1
del *.tmp
copy blank.txt tempname.tmp > 1.tmp
sc %1 query bufsize= 10000 state= all | grep -i "SERVICE_NAME: MSSQL" > servlist.tmp
@for /f "tokens=1" %%b in (servlist.tmp) do if "%%b" == "SERVICE_NAME:" echo %1 > tempname.tmp
type tempname.tmp >> namelist.txt
goto ExitBatch
:ErrorInParm
echo ERROR. No input paramater.
goto ExitBatch
:ExitBatch
REM CheckBox.Bat ends here.