batchfile for internet reconnect

Dora Daff

Estimable
Jul 18, 2014
2
0
4,510
0
Hi, i want to create a batch file that scans if my pc is connected to the internet and if its not connected the script executes bachfile 1 (called ipconfig renew.bat)

ipconfig /release
ping -n 5 127.0.0.1
ipconfig /renew

my solution for this "problem" wouldve been

@echo off
:loop
ping www.google.com -n 1 -w 5000 > nul
if errorlevel 1 "ipconfig renew.bat"
ping -n 30 127.0.0.1 > nul
goto loop

but after the script has executed "ipconfig renew.bat" it closes and doesnt loop.
So how should i rewrite this?

 
Thread starter Similar threads Forum Replies Date
botguy Apps General Discussion 2
Kappa12 Apps General Discussion 1
V Apps General Discussion 0
D Apps General Discussion 0
M Apps General Discussion 1
Zugoldragon Apps General Discussion 2
Versasex Apps General Discussion 4
O Apps General Discussion 2
P Apps General Discussion 3
T Apps General Discussion 1
M Apps General Discussion 1
D Apps General Discussion 7
R Apps General Discussion 3
T Apps General Discussion 1
G Apps General Discussion 12
A Apps General Discussion 3
I Apps General Discussion 2
J Apps General Discussion 6
A Apps General Discussion 10
D Apps General Discussion 2

ASK THE COMMUNITY