This page has been robot translated, sorry for typos if any. Original content here.

Script pingovalka to maintain Gprs-connection

Скрипт-пинговалка для поддержания Gprs-соединения

Quite often, operators (and providers) offer cheap Internet - or even provide anlim.

But we are not all like people, just can not be happy.

Often the connection is broken or "plugged" "stuck" (when the connection is not broken, but the data does not go).

Anyone who encounters this problem will be helped by a simple pingalo script.

Its meaning: the address is periodically pinged. In the absence of ping (when the channel is “stuck” or broken), a reconnection occurs.

By running this script, you can be sure that the connection is working.


1. Create a cmd file (for example, pinger.cmd) in notepad with the following contents:

 @echo off
 echo% date%% time% --- STARTED --- >> pinger.log
 set Try = 1

 rem All settings are in this block.

 rem connection name
 set DialName = Life
 rem login
 set Login = Login
 rem Password
 set Pass = Password
 rem ping timeout in ms
 set TimeOut = 10000
 rem number of ping attempts
 set MaxPing = 5
 rem pause in s
 set Pause = 30
 rem ping host address
 set host =
 rem your phone number
 set PhoneNum = 80631234567

 : start
 echo start ping
 ping% host% -n 1 -w% TimeOut%
 if errorlevel = 1 goto bad
 goto ok

 : ping
 ping% host% -n 1 -w% TimeOut%
 if not errorlevel = 1 goto ok
 set / a Try =% Try% + 1
 if% try% geq% maxping% goto bad
 goto ping

 : ok
 goto end

 : bad
 set / a Try = 1
 echo% date%% time% -!  Trouble, reconnect! - >> pinger.log
 rasdial% DialName% / disconnect
 rasdial% DialName% / phone:% PhoneNum%
 rasdial% DialName%% Login%% Pass%
 if errorlevel = 1 goto bad
 goto ping

 : end
 set / a Try = 1
 choice / C: PRDE / T: P, 30 / N Pause 30 seconds.  [P] ing [R] econnect [D] isconnect [E] xit?
 rem echo.
 rem echo.
 goto ping
 : 2
 goto bad
 : 3
 rasdial% DialName% / disconnect
 echo% date%% time% == Exit script == >> pinger.log

In this file you need to replace MANDATORY :

  • connection name (set DialName = Life) [see the name: Start - Settings - Network connections - the name of your connection]
  • login / password (set Login = Login set Pass = Password) - if it is required to establish a connection

In this file, you need to replace (if desired):

  • host address that is pinged (set host =
  • ping timeout (set TimeOut = 10000)
  • the number of ping attempts (set MaxPing = 5) after which there will be a reconnection
  • connection test interval (set Pause = 30)

2. Next to pinger.cmd put "" from the archive choise.rar.

3. We start and enjoy life - pingovalka will establish a connection and will maintain it in working condition.

!!! A similar script "pinger" for Linux to maintain the dedicated

choise.rar (2.88 kilobytes) choise.rar (2.88 kilobytes) choise.rar (2.88 kilobytes) Virus Free by KAV (684 bytes) (684 bytes) (684 bytes) Virus Free by KAV