Solved

Script commands to test Internet connection

Posted on 2014-04-24
3
593 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
3 Comments
 
LVL 34

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

I found out last night windows update has a problem regarding 4 latest updates that fail.  The way to get all 4 them installed is install sp1 first and restart then one by one with a resart in between as they fail every time if all the four updates …
OfficeMate Freezes on login or does not load after login credentials are input.
In this Micro Tutorial viewers will learn how to use Boot Corrector from Paragon Rescue Kit Free to identify and fix the boot problems of Windows 7/8/2012R2 etc. As an example is used Windows 2012R2 which lost its active partition flag (often happen…
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.

757 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

21 Experts available now in Live!

Get 1:1 Help Now