Jump to content

running script when network connectivity is back


Recommended Posts

Guest sharonag
Posted

Hi,

If I have a network failure,

Is it possible some how to recognize that network is back again and to

execute a desired script?

 

thanks

  • Replies 2
  • Created
  • Last Reply

Popular Days

Guest Pegasus \(MVP\)
Posted

Re: running script when network connectivity is back

 

 

"sharonag" <sharonag@gmail.com> wrote in message

news:1192005237.902408.24140@g4g2000hsf.googlegroups.com...

> Hi,

> If I have a network failure,

> Is it possible some how to recognize that network is back again and to

> execute a desired script?

>

> thanks

>

 

You could use the Task Scheduler to run this batch

file once every five minutes.

 

@echo off

ping 192.168.0.1 | find /i "bytes=" > nul || goto :Fail

if not exist "%temp%\NWFail.txt goto :eof

del "%temp%\NWFail.txt

{Your script command goes here}

goto :eof

 

:Fail

echo %date% %time%: Network failed >> "%temp%\NWFail.txt

Guest sharonag
Posted

Re: running script when network connectivity is back

 

On 10 , 12:00, "Pegasus \(MVP\)" <I....@fly.com> wrote:

> "sharonag" <sharo...@gmail.com> wrote in message

>

> news:1192005237.902408.24140@g4g2000hsf.googlegroups.com...

>

> > Hi,

> > If I have a network failure,

> > Is it possible some how to recognize that network is back again and to

> > execute a desired script?

>

> > thanks

>

> You could use the Task Scheduler to run this batch

> file once every five minutes.

>

> @echo off

> ping 192.168.0.1 | find /i "bytes=" > nul || goto :Fail

> if not exist "%temp%\NWFail.txt goto :eof

> del "%temp%\NWFail.txt

> {Your script command goes here}

> goto :eof

>

> :Fail

> echo %date% %time%: Network failed >> "%temp%\NWFail.txt

 

thanks but by this solution I can put my harmless script in the

scheduale as well instead of checking if I have network again.

I'm looking for some "trigger" solution.


×
×
  • Create New...