Solved

Internet Connection Util

Posted on 2016-10-14
8
102 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 93

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 93

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
Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

 
LVL 53

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 53

Expert Comment

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

Featured Post

Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

Question has a verified solution.

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

When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup" or a blinking cursor with black screen. A loop for Auto repair will start but fix nothing.  You will be panic as there are no back…
Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

860 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