Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Script commands to test Internet connection

Posted on 2014-04-24
3
Medium Priority
?
700 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 600 total points
ID: 40021300
ping www.yahoo.com -t

This will keep pinging yahoo.

HTH,
Dan
0
 
LVL 15

Accepted Solution

by:
achaldave earned 1400 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

One of the features I've come to appreciate about Windows 7 and Windows Server 2008 R2 is the ability to pin applications to the task bar. As useful a feature as I've found this, it does have some quirks.  For example, have you ever tried pinning an…
If you get continual lockouts after changing your Active Directory password, there are several possible reasons.  Two of the most common are using other devices to access your email and stored passwords in the credential manager of windows.
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 basic overview of Windows Live Photo Gallery and show you various editing filters and touches to photos you can apply. This will be demonstrated using Windows Live Photo Gallery on Windows 7 operating system.
Suggested Courses

636 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