Solved

Internet Connection Util

Posted on 2016-10-14
8
91 Views
Last Modified: 2016-10-17
I'm looking for a util that can determine if a computer has a connection to the Internet.  Computer is a Windows 10 system.

Must be simple to operate and understand.  What I have in mind is a simple click button to launch the application and a message that appears to say "Internet connected" or "Internet down".  That is the idea of the simplicity I want in this util.  Perhaps there is a batch file that could do the job?

Anyone know if there is a util around like this?
0
Comment
Question by:dbrunton
  • 2
  • 2
  • 2
  • +2
8 Comments
 
LVL 92

Expert Comment

by:John Hurst
ID: 41844247
There is a Wired or Wireless connection ICON in Windows 10. Hover over it. It will tell you whether you have Internet Access or not. If you have a connection (IP address) and no Internet, it will tell you precisely that.

It is there to use and it works.
0
 
LVL 48

Author Comment

by:dbrunton
ID: 41844262
Yes, but this is for a relative for whom the task of hovering the mouse over an icon and reading the result would be too difficult.  The computer for her is a complex beast and she uses it only for FreeCell and Skype.

Getting her to click on a button is far, far easier to do.
0
 
LVL 92

Expert Comment

by:John Hurst
ID: 41844277
So then write a little script to PING an external address forever. If it breaks there would be no internet. I think that will work.

I am always able to get people to put their mouse over a distinct icon but I recognize that not everyone could do this
0
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
LVL 52

Accepted Solution

by:
Joe Winograd, EE MVE earned 500 total points
ID: 41844321
I had this same issue a while ago. Needed a solution for an AutoHotkey script and found this thread at the AHK forum:
https://autohotkey.com/boards/viewtopic.php?f=5&t=20323

The crux of it is this function:

InternetConnection()
{
  WebRequest := ComObjCreate("WinHttp.WinHttpRequest.5.1")
  WebRequest.Open("GET", "http://www.timeapi.org/utc/now")
  WebRequest.Send()
  Return (SubStr(WebRequest.ResponseText, 5, 1) = "-")
}

Open in new window

I'm sure you can convert that to whatever scripting language you prefer.

> What I have in mind is a simple click button to launch the application and a message that appears to say "Internet connected" or "Internet down".

The following call to that function would do what you want:

If InternetConnection()
  MsgBox,Internet connected
Else
  MsgBox,Internet down
ExitApp

Open in new window


Again, convert that to whatever scripting language you prefer. Considering AutoHotkey, if you want to run the script on systems without AutoHotkey installed, simply compile it into a stand-alone EXE file (using the AutoHotkey compiler on your dev machine, which is part of a standard AutoHotkey install). I've run those EXE files on all versions of Windows from XP to W10 (and everything in between), both 32-bit and 64-bit. For "a simple click button to launch", simply create a shortcut to the EXE file and put it on the desktop, place it in the Start menu, pin it to the taskbar, etc.  Regards, Joe

Regards, Joe
0
 
LVL 92

Expert Comment

by:nobus
ID: 41844699
i usually click on the big E for internet explorer
if it says no connection - or does not display  the start page, i know i have no internet
0
 
LVL 69

Expert Comment

by:Qlemo
ID: 41845931
The whole can only work by testing one or a few Internet locations. A batch file like
@echo off
>nul ( ping -n 1 1.1.1.1 || ping -n 1 8.8.8.8) && echo Internet works || echo The Internet has been deleted!
pause

Open in new window

could work (testing two Google DNS servers).
0
 
LVL 48

Author Closing Comment

by:dbrunton
ID: 41846028
This works beautifully.  Just finished testing on the user's Windows 10 machine.  Now I have a nice easy method to diagnose the Internet connection over the phone line.

Thanks Joe.
0
 
LVL 52

Expert Comment

by:Joe Winograd, EE MVE
ID: 41846755
You're welcome. I'm glad that works for you. Cheers, Joe
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I will show you HOW TO: Perform a Physical to Virtual (P2V) Conversion the easy way from a computer backup (image).
How to record audio from input sources to your PC – connected devices, connected preamp to record vinyl discs, streaming media, that play through your audio card: Vista, Windows 7, Windows 8, Windows 8.1 and Windows 10 – both 32 bit & 64.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

815 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now