Any command way to set up ips?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

I've a Laptop with XP, when I'm @office I've to connect without default IP and gateway(IP Addresses will be obtained automatically) and when I'm @home I've to give static ip addresses of cable net provider. It's annoying me to change these very frequently. Is there any way to write a batch file(or any similar program) which I can run it when ever I want where as that program should be able to change ip settings according to my requirements

Is it possible?

Thanks in advance
Regards
Kavi Kumar
 
Hi,

I've a Laptop with XP, when I'm @office I've to connect without default IP and gateway(IP Addresses will be obtained automatically) and when I'm @home I've to give static ip addresses of cable net provider. It's annoying me to change these very frequently. Is there any way to write a batch file(or any similar program) which I can run it when ever I want where as that program should be able to change ip settings according to my requirements.

Is it possible??

Thanks in advance,
Regards,
Kavi Kumar

The "netsh" command does exactly what you want. Put it in a batch
file or type it at a command prompt.

Here's an example that sets a static IP address, subnet mask, default
gateway, and metric for the connection called "Local Area Connection":

netsh interface ip set address "Local Area Connection" static
192.168.0.10 255.255.255.0 192.168.0.1 1

To obtain the IP configuration automatically:

netsh interface ip set address "Local Area Connection" dhcp
--
Best Wishes,
Steve Winograd, MS-MVP (Windows Networking)

Please post any reply as a follow-up message in the news group
for everyone to see. I'm sorry, but I don't answer questions
addressed directly to me in E-mail or news groups.

Microsoft Most Valuable Professional Program
http://mvp.support.microsoft.com
 
NUMBERS LIKE THESE, 192.168.0.10 255.255.255.0
192.168.0.1, are these the numbers web sites use to record
your activity and identify who you are? Can these be
changed, or are they part of your computer? Thanks!
-----Original Message-----
without default IP and gateway(IP Addresses will be
obtained automatically) and when I'm @home I've to give
static ip addresses of cable net provider. It's annoying
me to change these very frequently. Is there any way to
write a batch file(or any similar program) which I can run
it when ever I want where as that program should be able
to change ip settings according to my requirements.
 
You can also leave your IP configuraton as automatic. Then configure an
alternate IP address with your ISPs configuration for home use. When you
PCs cannot find a DHCP server at home, the alternate address will kick in.

IP and gateway(IP Addresses will be obtained automatically) and when I'm
@home I've to give static ip addresses of cable net provider. It's annoying
me to change these very frequently. Is there any way to write a batch
file(or any similar program) which I can run it when ever I want where as
that program should be able to change ip settings according to my
requirements.
 
And one more possibility:

When you have your laptop correctly configured for your office
network, you can save the network configuration for later restoration.
netsh -c interface dump > c:\configs\officeinterface.txt

Now lets say you take it home and reconfigure it correctly for you
home network. To save you home network configuration for later use:

netsh -c interface dump > c:\configs\homeinterface.txt

OK. Now you take the laptop back to the office and you need to
reconfigure for the office environment: nic address, wins, gateway
address... Use the following command to restore your office network
interface:

netsh -f c:\configs\officeinterface.txt

At end of day, you take it home. To setup for home, run:

netsh -f c:\configs\homeinterface.txt

As you can imagine, this is very valuable if you have get your laptop
to function in multiple network locations.

The netsh -f <configuration file> is perfectly batchable. Create a
Home.bat and and Office.bat and just click to restore your settings
for either location.

(based on a note from is-it-true.com]

Best,
Bill Castner
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top