Dein Problem laesst sich mittels einem simplen Script lösen.. kopier das in eine
Datei benenne sie meinetwegen OnPingFailRunExe.vbs, passe den Hostnamen
und die zu startende Datei an und starte das Ding mittels cscript.exe, falls
nötig, gekapselt in einer anderen Endlosbatch..
Viel Spass.. 8)
tb'..
------
'///////////////////////////////////////////////////////////////////////////////////////////////////////
'// OnPingFailRunExe.vbs tb' in o9/o2
'///////////////////////////////////////////////////////////////////////////////////////////////////////
'///////////////////////////////////////////////////////////////////////////////////////////////////////
dim sBatchFileToRun
sBatchFileToRun = "c:\MeinBatchFile.bat"
dim sHostnameOrIPToPing
sHostnameOrIPToPing = "hostname"
dim iWaitXSeconds
iWaitXSeconds = 10
dim oShell
set oShell = CreateObject("WScript.Shell")
dim iResult
while iResult = 0
On Error Resume Next
iResult = oShell.Run( "ping.exe -n 1 " & sHostnameOrIPToPing, false, true)
if (err) then
WScript.echo "Error running 'ping.exe'..
" + chr(10)
iResult = -1
else
if (iResult) then WScript.Sleep( iWaitXSeconds * 1000)
end if
wend
if (iResult <> -1) then
WScript.echo "Host is down, starting batch/exe.." + chr(10)
On Error Resume Next
iResult = oShell.Run( sBatchFileToRun, false, true)
if (err) then
WScript.echo "Execution failed..
" + chr(10)
WScript.quit 5
end if
end if
-----------