Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account



Photo

Change default gateway by script

- - - - -

  • Please log in to reply
4 replies to this topic

#1
Bad boy Warrior

Bad boy Warrior

    Advanced Member

  • Member
  • PipPipPip
  • 411 posts
  • Joined 03-February 05
  • OS:Windows 8 x64
  • Country: Country Flag
Hello all

Looking for a quick solution to this. I want to change the default gateway on all the PCs (running XP) from what it is to another address. I dont think you can do this by GP and unforunately we dont have DHCP setup so i guess its got to be done by script.

Can anyone help here?

Thanks
I say what I do and do what I mean - Heat


How to remove advertisement from MSFN

#2
druiddk

druiddk

    Member

  • Member
  • PipPip
  • 215 posts
  • Joined 30-November 05
Hey Bad Boy ;)

You can do this using the netsh command. It should be something in the lines of:

netsh interface ipv4 set address "Local area connection" gateway BLAH BLAH :-)
Please rate my post :)

#3
Bad boy Warrior

Bad boy Warrior

    Advanced Member

  • Member
  • PipPipPip
  • 411 posts
  • Joined 03-February 05
  • OS:Windows 8 x64
  • Country: Country Flag
Thanks strangely when i get to the

netsh interface>

prompt, it doesnt recongnise ipv4 - but ipv6 s listed when i type "help", kind of lost here

Also i cant run this as a batch script. I think i need something similar to sendKeys so when the script sees Netsh it presses enter to get into the sub text for interface (think SendKeys is for vbs)- maybe im wrong but some guidance needed here.

Thank you

Edited by Bad boy Warrior, 14 May 2007 - 07:09 AM.

I say what I do and do what I mean - Heat

#4
Sonic

Sonic

    Sonic

  • Patrons
  • 1,637 posts
  • Joined 04-December 03

Hey Bad Boy ;)

You can do this using the netsh command. It should be something in the lines of:

netsh interface ipv4 set address "Local area connection" gateway BLAH BLAH :-)


I think you use vista, isn't it ?

For WinXP, I use that code
netsh interface ip set address name="Local Area Connection" static IP MASK GATEWAY
netsh interface ip set dns name="Local Area Connection" static DNS
Replace IP by IP adress of the machine
Replace MASK by mask
Replace GATEWAY by ip gateway adress
Replace DNS by ip of dns

#5
Bad boy Warrior

Bad boy Warrior

    Advanced Member

  • Member
  • PipPipPip
  • 411 posts
  • Joined 03-February 05
  • OS:Windows 8 x64
  • Country: Country Flag

Hey Bad Boy ;)

You can do this using the netsh command. It should be something in the lines of:

netsh interface ipv4 set address "Local area connection" gateway BLAH BLAH :-)


I think you use vista, isn't it ?

For WinXP, I use that code
netsh interface ip set address name="Local Area Connection" static IP MASK GATEWAY
netsh interface ip set dns name="Local Area Connection" static DNS
Replace IP by IP adress of the machine
Replace MASK by mask
Replace GATEWAY by ip gateway adress
Replace DNS by ip of dns


If your asking me if i use Vista (due to my question from previous post) - then yes and no by that i mean we do have vista but the problem is only relating to xp PCs - heres another twist to the problem these PCs use static IP addresses so i really dont want to touch that part and only the Gateway config - is that possible?

If it is possible do i need to run
netsh interface ip set dns name="Local Area Connection" static DNS
as the DNS config is fine??

Thanks

Edited by Bad boy Warrior, 14 May 2007 - 09:28 AM.

I say what I do and do what I mean - Heat




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users