Solved

Script commands to test Internet connection

Posted on 2014-04-24
3
659 Views
Last Modified: 2014-04-26
Running Windows 7 Pro on HP z210.

I am battling my internet provider.  My connection disconnects frequently.
I have to keep entering the command:  ping www.yahoo.com to see if the connection has failed.
I am working with the vendor to determine if the problem can be solved or whether I have to find a new Internet vendor.

In the meantime...  I don't want to have to keep entering the ping command.
I am aware there is a robust scripting language for Windows 7.

Q1.) What commands would I put into a script to determine if the internet  connection has failed?

Q2.)  what script commands would execute an mp3 file if the connection has failed?
0
Comment
Question by:donpick
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 35

Assisted Solution

by:Dan Craciun
Dan Craciun earned 150 total points
ID: 40021300
ping www.yahoo.com -t

This will keep pinging yahoo.

HTH,
Dan
0
 
LVL 15

Accepted Solution

by:
achaldave earned 350 total points
ID: 40021362
Try this, create .bat file, replace c:\temp\myfile.mp3 with path to mp3 file you want to play.

@setlocal enableextensions enabledelayedexpansion
@echo off
set target=%1

:testconnection

ping -n 1 !target! >nul: 2>nul:
if  !errorlevel!==0  (
    echo Response Recieved from !target!
   
) Else (
    echo Lost connection to !target!
start C:\temp\myfile.mp3
    goto :eof
)


goto :testconnection
endlocal
:eof
0
 

Author Closing Comment

by:donpick
ID: 40025306
Thank you for your fast responses
0

Featured Post

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
OfficeMate Freezes on login or does not load after login credentials are input.
This Micro Tutorial will go in depth within Systems and Security in Windows 7 and will go into detail regarding Action Center, Windows Firewall, System, etc. This will be demonstrated using Windows 7 operating system.
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum editing capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.

691 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