Dark Developments Where Knowledge Meets Power

12Jun/120

BATCH – Check Network Connection

Posted by Dark#Basics

BATCH - Check Network Connection

A couple of days ago we've installed a ThinClient at one of our customers. The point of the TC is to start a web browser in FullScreen mode and preform as an information screen. The website itself refreshes at a certain time displaying new information. The problem was that the network connection was done wireless and thus when the client is booted we'll need to check the network connection before running the browser. The following BATCH script did the trick.

Select All Code:
1
2
3
4
5
6
7
8
@echo off
set ip=8.8.8.8
 
:check_loop
ping -n 1 %ip%
if %ERRORLEVEL% NEQ 0 goto check_loop
 
START [PATH TO CHROME-LNK]
Filed under: Batch, Programming No Comments