HTFC Forums

H.T.F.C.

How To Fix Computers





Go Back   HTFC Forums > Software Newsgroups > Windows XP > XP Networking

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1  
Old 04-28-2004, 09:11 AM
Koneti
 
Posts: n/a
Default Any command way to set up ips?

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
Reply With Quote
Sponsored Links
Fix your Windows Problems - FAST.
FREE Safe Scan Registry Check. Locate & Fix Errors in Minutes!
  #2  
Old 04-28-2004, 10:02 AM
Steve Winograd [MVP]
 
Posts: n/a
Default Re: Any command way to set up ips?

In article <E53F8B57-853D-4D4F-B3CA-612A1F663ECF@microsoft.com>,
Koneti <kavikumark@hotmail.com> wrote:
>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
Reply With Quote
  #3  
Old 04-28-2004, 05:32 PM
anonymous@discussions.microsoft.com
 
Posts: n/a
Default Re: Any command way to set up ips?

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-----
>In article <E53F8B57-853D-4D4F-B3CA-

612A1F663ECF@microsoft.com>,
>Koneti <kavikumark@hotmail.com> wrote:
>>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
>.
>

Reply With Quote
  #4  
Old 04-28-2004, 06:04 PM
Rob Elder MVP-Networking
 
Posts: n/a
Default Re: Any command way to set up ips?

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.

"Steve Winograd [MVP]" <winograd@pobox.com> wrote in message
news:43su80lgc5j67b5oo4udrp805kms1ulv9h@4ax.com...
> In article <E53F8B57-853D-4D4F-B3CA-612A1F663ECF@microsoft.com>,
> Koneti <kavikumark@hotmail.com> wrote:
> >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



Reply With Quote
  #5  
Old 05-01-2004, 01:31 AM
Bill Castner
 
Posts: n/a
Default Re: Any command way to set up ips?

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





On Wed, 28 Apr 2004 13:04:42 -0400, "Rob Elder MVP-Networking"
<relder@thisisnotright.com> wrote:

>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.
>
>"Steve Winograd [MVP]" <winograd@pobox.com> wrote in message
>news:43su80lgc5j67b5oo4udrp805kms1ulv9h@4ax.com.. .
>> In article <E53F8B57-853D-4D4F-B3CA-612A1F663ECF@microsoft.com>,
>> Koneti <kavikumark@hotmail.com> wrote:
>> >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

>


Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
MS-DOS - COMMAND Scott Windows Vista 39 08-08-2007 09:11 PM
help with command line Rob Windows XP 3 08-08-2007 09:09 PM
COMMAND LINE NET COMMAND? Jethro Windows XP 8 07-24-2007 04:13 PM
Solved: unrecognized external command error in command window FUBARinSFO Windows XP 0 06-23-2007 11:15 PM
run command Martin Windows Vista 3 04-24-2007 09:10 PM


All times are GMT. The time now is 12:13 PM.


Powered by vBulletin® Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0
© 2004 - 2007 Web-S-Sense Pty. Ltd. Usenet and forums posts © their respective authors.
Ad Management by RedTyger