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

Advertisements

One response to this post.

  1. nice 😉

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: