Jump to content
Sign in to follow this  
FEDER1C0

RESET Network Connection if Speed drops to 0

Recommended Posts

FEDER1C0

Hi guys

good day to all. I'm looking for some script to reset my connection when my network speed doesn't work or if I can't ping google for

example.

I tried looking for a similar topic but i have a hard time searching for scripts in the forum. hope you can help me. thanks.

If it exists. please post the link. 

Thanks again.  :sweating:

Share this post


Link to post
Share on other sites
5471665561

The code below will do the following:

-Every second, ping google.

-if google does not respond in 4 seconds, then disable the local area connection, wait 3 seconds, then re-enable it. Then wait 15 seconds before checking again

-if google does respond in that time, then re-check in 1 second again

Note: I only tested this on Windows 7

While True
     Sleep(1000)
     If ping("www.google.com") == 0 Then
          run('wmic path win32_networkadapter where NetConnectionID="Local Area Connection" call disable')
          sleep(3000)
          run('wmic path win32_networkadapter where NetConnectionID="Local Area Connection" call enable')
          sleep(15000)
     EndIf
WEnd
Edited by Durnt
  • Like 1

Share this post


Link to post
Share on other sites
Bert

I'm trying to find out why you need to disable it then re-enable it. Is this happening @ home? @work? Do you have a router? Cable modem? Knowing your setup would be helpful. Just resetting your connection is not the solution. Figuring out the cause of your issue and getting it fixed is.

Share this post


Link to post
Share on other sites
FEDER1C0

thanks MVP i dont know. Im new here. seems like our line is being monitored and i figured the only way i go with my internet connection  is via resetting

I read get tons of PDFs on line and when i finish 2 of the at a time my line keeps disconnected. I don't know why. Im not in good terms with the IT either.

I ask my colleagues if i can do the downloading for PDFs and they told me its okay.

My guess is thats my last resort. 

THANKS for all the help

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×