Welcome Guest ( Log In | Register )



2 Pages V  < 1 2  
Reply to this topicStart new topic
> Switch Network Settings With Batch Files, A quick way to change IP, Gateway, DNS
iGuest
post May 23 2008, 02:38 PM
Post #11


Newbie [ Level 1 ]
Group Icon

Group: Members
Posts: 0
Joined: 1-November 07
Member No.: 25,869



VISTA UPDATE
Switch Network Settings With Batch Files

Replying to Feedbacker

VISTA UPDATE


I've written the vista update at
Http://samanathon.Com/set-your-ip-address-via-batch-file/

Sorry to link to another site but it saves me typing it all out again!!

-reply by Razzor
Go to the top of the page
 
+Quote Post
iGuest
post May 24 2008, 12:53 PM
Post #12


Newbie [ Level 1 ]
Group Icon

Group: Members
Posts: 0
Joined: 1-November 07
Member No.: 25,869



Doesn\\
Switch Network Settings With Batch Files

Netsh interface ip set address name="LAN-verbinding 4" source=static addr=192.168.0.99 mask=255.255.255.0

Netsh interface ip set address name="LAN-verbinding 4" gateway=192.168.0.100 gwmetric=0

Netsh interface ip set dns name="LAN-verbinding 4" source=static addr=195.130.131.11

Netsh interface ip add dns name = "LAN-verbinding 4" addr = 195.131.131.12

Pause

Hi, I'm having a strange problem. I copy-pasted the code above, made my changes (as you can see) but nothing in the code itself. But he won't set my ip-address and my subnetmask. I have to say I'm working with a laptop with vista. I've had a lot of problems with security and access and stuff. But now he didn't complain about anything, he setted eveything except for ip and subnet. Can anyone help? Ty ^^

-reply by Emmy
Go to the top of the page
 
+Quote Post
iGuest
post May 25 2008, 01:23 PM
Post #13


Newbie [ Level 1 ]
Group Icon

Group: Members
Posts: 0
Joined: 1-November 07
Member No.: 25,869



VISTA UPDATE
Switch Network Settings With Batch Files

- For Vista users only, I've written it here as well-

@ECHO OFF

Set varip=192.168.1.100
Set varsm=255.255.255.0
Set vargw=192.168.1.1
Set vardns1=66.78.202.254
Set vardns2=66.78.210.254

ECHO Setting IP to static
Netsh int ipv4 set address name = �Wireless Network Connection� source = static address = %varip% mask = %varsm%

ECHO Setting IP Address and Subnet Mask
Netsh int ipv4 set address name = �Wireless Network Connection� address = %varip% mask = %varsm% gateway = %vargw% gwmetric = 1

ECHO Setting Primary DNS
Netsh int ip set dns name = �Wireless Network Connection� source = static addr = %vardns1%

ECHO Setting Secondary DNS
Netsh int ip add dns name = �Wireless Network Connection� addr = %vardns2%

ECHO Here are the new settings for %computername%:
Netsh int ip show config

Pause

The change is quite simple�the problem seems to lie in vista�s inability to set the ip to static, and assign the ip address at the same time. So all you have to do is set up the ip to static first, then set the ip�very strange!

Note that your static ip is not displayed when shown, however it is set.

Just change the variables at the beginning to your settings and if needs be, change "wireless network connection" to the name of your connection eg. "LAN-verbinding 4"

-reply by Razzor
Go to the top of the page
 
+Quote Post
wutske
post May 29 2008, 09:41 AM
Post #14


Way Out Of Control - You need a life :)
Group Icon

Group: [HOSTED]
Posts: 1,044
Joined: 2-August 05
From: Kapellen (Antwerp, Belgium)
Member No.: 7,585



Thank you very much for looking this up for us wink.gif (and bumping this post, I've been looking for it for a while, but now I don't need it for a few months tongue.gif ).
Go to the top of the page
 
+Quote Post
iGuest
post Jun 3 2008, 04:42 AM
Post #15


Newbie [ Level 1 ]
Group Icon

Group: Members
Posts: 0
Joined: 1-November 07
Member No.: 25,869



Thanks
Switch Network Settings With Batch Files

Great stuff. Keep up the good work



-reply by Pyous
Go to the top of the page
 
+Quote Post
iGuest
post Jun 10 2008, 12:10 PM
Post #16


Newbie [ Level 1 ]
Group Icon

Group: Members
Posts: 0
Joined: 1-November 07
Member No.: 25,869



Vista problems
Switch Network Settings With Batch Files

Hiya,

Have you tried running it by right clicking and using 'run as administrator' instead.

It worked for me as I was getting the:

This command needs to be elevated

HTH

-reply by Andy Holland
Go to the top of the page
 
+Quote Post
iGuest
post Jun 7 2008, 09:43 AM
Post #17


Newbie [ Level 1 ]
Group Icon

Group: Members
Posts: 0
Joined: 1-November 07
Member No.: 25,869



Vista settings
Switch Network Settings With Batch Files

Emmy- that's because you need to type the following into a batch file:

@ECHO OFF

Set varip=192.168.0.99
Set varsm=255.255.255.0
Set vargw=192.168.0.100
Set vardns1=195.131.131.11
Set vardns2=195.131.131.12

ECHO Setting IP to static
Netsh int ipv4 set address name = "LAN-verbinding 4" source = static address = %varip% mask = %varsm%

ECHO Setting IP Address and Subnet Mask
Netsh int ipv4 set address name = "LAN-verbinding 4" address = %varip% mask = %varsm% gateway = %vargw% gwmetric = 1

ECHO Setting Primary DNS
Netsh int ip set dns name = "LAN-verbinding 4" source = static addr = %vardns1%

ECHO Setting Secondary DNS
Netsh int ip add dns name = "LAN-verbinding 4" addr = %vardns2%

ECHO Here are the new settings for %computername%:
Netsh int ip show config

Pause

-reply by Razzor
Go to the top of the page
 
+Quote Post
iGuest
post Jul 1 2008, 11:53 AM
Post #18


Newbie [ Level 1 ]
Group Icon

Group: Members
Posts: 0
Joined: 1-November 07
Member No.: 25,869



how to add the one more ip address to a batch file
Switch Network Settings With Batch Files

Hi,


Iam Rajkumar working in crystal granite marble pvt ltd.


Here our lan ip is 192.168.0.1 subnetmask is 255.255.255.0

And internet ip is 10.7.192.81 subnetmask is 255.255.255.240


I want to add the one moreip address to the above mentioned batchfile


I can add the one more dns also but iam not able to add the ip address


Please help me in this scenario



Thnaks and Regards,
Rajkumar.S

-reply by RAJKUMAR
Go to the top of the page
 
+Quote Post
iGuest
post Jun 28 2008, 02:45 PM
Post #19


Newbie [ Level 1 ]
Group Icon

Group: Members
Posts: 0
Joined: 1-November 07
Member No.: 25,869



Thanks
Switch Network Settings With Batch Files

I'm using vista but it didn't work as mentioned above

I tried

Set address name="Wireless Network Connection" static 192.168.0.100 255.255.255.0 192.168.0.1 1

And now it works perfectly!

-reply by Quang Tran
Go to the top of the page
 
+Quote Post

2 Pages V  < 1 2
Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics


 



- Lo-Fi Version Time is now: 11th October 2008 - 06:38 AM