Hello all,
I'm designing a new machine that include two robots and two controllers.
Both robots come with Windows installed.
Both controllers come with Windows embedded standard installed.
Each controller takes a small amount of time to start.
Robots can vary the amount of time taken to start depending on the programs loaded and the state of the hard disk.
I will use each controller to make a remote connection to it's related robot.
I need to wait for the robot PC to be running before starting the remote connection (RealVNC probably will be the choosen).
How would you do it?
I can't think on a Wake on lan (to make the inverse process) because those controllers can't do that. so my only possibility is to wait until the robot is up...
I've tried this:
@setlocal enableextensions enabledelayedexpansion
@echo off
set ipaddr=%1
:loop
set state=down
for /f "tokens=5,7" %%a in ('ping -n 1 !ipaddr!') do (
if "x%%a"=="xReceived" if "x%%b"=="x1," set state=up
)
echo.Link is !state!
ping -n 6 127.0.0.1 >nul: 2>nul:
goto :loop
endlocal
Which always shows down state even if the computer is on...
And this:
@echo off
rem batch file to ping a Server until
rem it is available. Then wait 60 seconds
rem and connect using Terminal Services
rem syntax is: REMOTE <name_of_server>
rem ping host until it responds
:start
ping -n 1 %1
if %errorlevel% == 0 goto remote_desktop
rem wait for 10 seconds before trying again
@echo Waiting 10 seconds...
ping -n 10 127.0.0.1 > nul
rem loopback to start
goto start
rem initiate remote desktop session
:remote_desktop
@echo *****************************************************************
@echo *Server is now available. Waiting 1 minute for services to start*
@echo *****************************************************************
rem wait 60 seconds after server is available to
rem allow services to start
ping -n 60 127.0.0.1 > nul
mstsc /v:%1
Which never fails even when the computer is off...
Any idea on what is wrong on those scripts or a better approach?
Thank you in advance!