Question Locked

Need to change TCP/IP address easily and quickly for end users

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

We are passing out laptops to our end users and need the ability to set ip addresses very easily as they go from remote office to remote office that requires static ip address. Is there a script, a batch job or software that could do something like that?
thanks
stephen

3 replies

by joanne.e.m

Try the code below as a .bat file. Of course, put in your own ip address ranges for the variables (e.g. varip, varsm). ALSO, my "Local Area Connection" was actually called "NIC"; to check simply go to "Control Panel > Network Connections" and check what the connection you wish to use is called and substitute in place of "Local Area Connection"

Code:

@ECHO OFF

set varip=000.000.000.000
set varsm=255.255.255.0
set vargw=000.000.000.000
set vardns1=000.000.000.000
set vardms2=000.000.000.000
set varhome=www.google.com

ECHO Changing IP Address Settings
ECHO Setting IP Address and Subnet Mask
netsh int ip set address name = "Local Area Connection" source = static addr = %varip% mask = %varsm%

ECHO Setting Gateway
netsh int ip set address name = "Local Area Connection" gateway = %vargw% gwmetric = 1

ECHO Setting Primary DNS
netsh int ip set dns name = "Local Area Connection" source = static addr = %vardns1%

ECHO Setting Secondary DNS
netsh int ip add dns name = "Local Area Connection" addr = %vardns2%

ECHO Setting Internet Explorer Homepage to %varhome%
reg add "hkcu\software\microsoft\internet explorer\main" /v "Start Page" /f/d "%varhome%"

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

pause

This discussion is closed to new replies.