Archive for the ‘Scripts’ Category

First [Last] Windows script :)

We have visited our friends in Liepaja this weekend.
One of the best cities in Latvia by the way.

I was asked to fix problem with Internet. Guy from Internet company complained that problem is related to computer hardware or OS, guy who helped to install and set the computer complained about modem and Internet company.

Anyway, the problem was that modem has to be restarted [switch off/on] to get the Internet working after computer reboot or shutdown.
The problem was to handle DHCP lease correctly, renew was required some time after reboot.

So I’ve created virus.bat file and placed it into autostart 🙂

ipconfig /release
ipconfig /renew

But it was not enough to solve the problem, .bat file was loaded immediately and there was no any effect. Pause was required to get it working.
I’m not guru of the Windows command line interface, there was no any idea what the syntax for pause command.

There is nice workaround,

PING -n 10 127.0.0.1>nul

I’ve added ping for 10 seconds to computer itself, just change 10 and you will change pause interval for you script.

Script