Batch file to verify remote PC Connections

April 3, 2012 at 18:55:31
Specs: Windows 7
Running windows 2008 server - redundant servers - I need to verify 8 out of 10 PCs are connected before program on active server can start.

See More: Batch file to verify remote PC Connections

Report •

#1
April 5, 2012 at 13:08:54
I had a similar requirement when dealing with some patch management application reboot sequencing.

I used SC to determine if the server was fully up and responding to requests (vs. simply network up but not ready to accept any type of connection)


In your case I would try:

@echo off
:top
:: Server 1 Check
sc \\ServerName1Here query "ServiceNameHere"  | findstr /I running
If %errorlevel% neq 0 goto top
cls

:: Server 2 Check
:server2
sc \\ServerName2Here query "ServiceNameHere"  | findstr /I running
If %errorlevel% neq 0 goto server2
cls

:: Server 3 Check
:server3
sc \\ServerName3Here query "ServiceNameHere"  | findstr /I running
If %errorlevel% neq 0 goto server3
cls

... and so on .. 


Start "" "YourProgramHere.exe"
exit


Report •
Related Solutions


Ask Question