Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: Check Internet connectivity automatically via script and reconnect

22 Aug 2012   #1

OS X 10.8
Check Internet connectivity automatically via script and reconnect

Hi all

I have a few computers that connect via rasdial to a bridged modem. They are dropping off randomly and frequently enough that its a pain to have to reset them manually everytime.

Does anyone know how I could write a script or something that would check for internet connectivity and if there is none then it would re dial the pppoe connection?



My System SpecsSystem Spec
23 Aug 2012   #2

OS X 10.8

If anyone is curious. This is how I solved the issue.

Friend of mine wrote a basic Powershell script:

$site = "Kelly-PC"
$wait = 60
$nl = [Environment]::NewLine

While ($TRUE)
if(!(Test-Connection -computer $site -count 1 -quiet))
Write-Host -ForegroundColor Red -NoNewline "Connection Down...$nl"
rasdial attdsl password
Write-Host -ForegroundColor Green -NoNewline "Connection Up...$nl"
Start-Sleep -Seconds $wait

$site is the name of the computer
$wait is the time in seconds before next test
and the "rasdial attdsl password" line dials my pppoe connection called attdsl with the specified user and password when no connection is available.
My System SpecsSystem Spec

 Check Internet connectivity automatically via script and reconnect

Thread Tools

Similar help and support threads
Thread Forum
Check URL using DOS script
Hi, I am using windows7 64 bit. I have a text file "sample.txt" and text file has 200000 image url's as like below
General Discussion
Can I force a user to log off automatically through a logon script?
Hi there I've trying to invoke a fix on the fly and have got a mixed windows workstation environment on my network. For particular reasons, I don't want my windows XP users to use a Windows 7 machine and equally I don't want a Windows 7 user to use a Windows XP machine. Silly I know but there...
Network & Sharing
Problem : automatically reconnect mapped drives at login
Hi, I have a small issue, more of an annoyance, getting my mapped drives to be automatically connected during login. I have 4 NAS folders that I have mapped as drives P,Q,R and S. When I first set them up, I specifically set it up such that they will be connected during login. It seems to...
Network & Sharing
Script to Check Processes then Launch
I would like a script that does the following: If ProcessA.exe NOT Running? Open ProgramA (Access link file) End If If ProcessB.exe NOT Running? Open ProgramB (Access link file) End If
General Discussion
WLM 2009 auto reconnect after internet reconnect
Hello, I have recently upgraded from XP to W7 Home Premium and ever since I have installer WLM if my internet connection drops WLM shows the countdown timer for auto reconnect, this timer counts down to 00 then doesn't even try to reconnect, the timer just starts counting down again, I never had...
BroadBand disconnect and don't reconnect automatically
i have beetel router (beetel 110 BX1). when i use the internet for a long time it gets disconnected. the disconnection happens when computer is idle or am not browsing. I'm able to ping the router when there is not internet access. i can see the LEDs which corresponds to data transfer blinking.....
Network & Sharing

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 12:22.
Twitter Facebook Google+ Seven Forums iOS App Seven Forums Android App