My PC is on 24 x 7 x 365 & I am a huge downloader. Of late, my internet connection gets disconnected after a while and I have to ipconfig /release and ipconfig /renew to resume my torrents. I wanted to automate this. So, with a little bit of help from google, I figured this out.
create a file r_r.bat in %systemroot% with the following contents
ipconfig /release *Hath*
echo The IP address has been released. Waiting to renew…
echo waiting for a minute
ping xyz.boogvgd.bam -w 5000>NUL
ipconfig /renew *Hath*
echo The IP address has been renewed
Here, replace *Hath* with you connection name. For ex. if you internet connection name is “Local Area Connection 1”, you could use *Local Area* OR *Connection 1* etc.
Now create another file chk_sts.bat in %systemroot% with the following contents.
ping -n 1 http://www.google.com > NULL
if errorlevel 1 r_r.bat
Save both the files.
Now go to Start–>Settings–>Control Panel –>Scheduled Tasks –>Add Scheduled Tasks.
Add a new task which will repeat itself every 10 minutes(the timing is upto you) using the chk_sts.bat file as the executable. Voila!!
Incase anyone wants to know the details, leave a comment and i’ll try my best.