pantz.org banner
Change your network settings using a script in Windows XP
Posted on 01-26-2006 15:22:00 UTC | Updated on 01-26-2006 15:22:00 UTC
Section: /software/windows/ | Permanent Link

If you use windows and need to change static network settings of your network interface card for the different networks you visit you can do this with a script. This is needed because windows only offers primary and secondary network settings for static network info. If you visit more than 2 networks on a regular basis then you would have to keep changing your network settings by hand. So I wipped up a batch file that will change the static settings for you. Just edit the settings below for your own network.

Then put the edited lines in a text file and save it. Rename the text file's extention to ".bat". We are just making a batch file to execute the commands. If the icon does not change from a text file to the batch file icon after you rename it then you will need to turn off "Hide file extentions of known file types". Do this by right clicking on the start menu and selecting "Explore". In file explorer click Tools->Folder Options->View (tab). Then uncheck "Hide file extentions of known file types". Ok out of all of that. Rename the file again and make sure it's extention is ".bat". Then just double click on the file to run the settings. Make a batch file for each network you visit. This should work in Win2k or XP.

Changes static network settings and DNS

netsh interface ip set address name="Local Area Connection" source=static addr=192.168.0.2 mask=255.255.255.0 gateway=192.168.0.1 1
netsh interface ip set dns name="Local Area Connection" source=static addr=192.168.0.1

Changes network settings from static to dhcp

netsh interface ip set address name="Local Area Connection" source=dhcp
netsh interface ip set dns name="Local Area Connection" dhcp

Reddit!

Related stories


RSS Feed RSS feed logo

About


3com

3ware

alsa

alsactl

alsamixer

amd

android

apache

areca

arm

ati

auditd

awk

badblocks

bash

bind

bios

bonnie

cable

carp

cat5

cdrom

cellphone

centos

chart

chrome

chromebook

cifs

cisco

cloudera

comcast

commands

comodo

compiz-fusion

corsair

cpufreq

cpufrequtils

cpuspeed

cron

crontab

crossover

cu

cups

cvs

database

dbus

dd

dd_rescue

ddclient

debian

decimal

dhclient

dhcp

diagnostic

diskexplorer

disks

dkim

dns

dos

dovecot

drac

dsniff

dvdauthor

e-mail

echo

editor

emerald

encryption

ethernet

expect

ext3

ext4

fat32

fedora

fetchmail

fiber

filesystems

firefox

firewall

flac

flexlm

floppy

flowtools

fonts

format

freebsd

ftp

gdm

gmail

gnome

google

gpg

greasemonkey

greylisting

growisofs

grub

hacking

hadoop

harddrive

hba

hex

hfsc

html

html5

http

https

hulu

idl

ie

ilo

intel

ios

iperf

ipmi

iptables

ipv6

irix

javascript

kde

kernel

kickstart

kmail

kprinter

krecord

kubuntu

kvm

lame

ldap

linux

logfile

lp

lpq

lpr

maradns

matlab

memory

mencoder

mhdd

mkinitrd

mkisofs

moinmoin

motherboard

mouse

movemail

mplayer

multitail

mutt

myodbc

mysql

mythtv

nagios

nameserver

netflix

netflow

nginx

nic

ntfs

ntp

nvidia

odbc

openbsd

openntpd

openoffice

openssh

openssl

openvpn

opteron

parted

partimage

patch

perl

pf

pfflowd

pfsync

photorec

php

pop3

pop3s

ports

postfix

power

procmail

proftpd

proxy

pulseaudio

putty

pxe

python

qemu

r-studio

raid

recovery

redhat

router

rpc

rsync

ruby

saltstack

samba

schedule

screen

scsi

seagate

seatools

sed

sendmail

sgi

shell

siw

smtp

snort

solaris

soundcard

sox

spam

spamd

spf

spotify

sql

sqlite

squid

srs

ssh

ssh.com

ssl

su

subnet

subversion

sudo

sun

supermicro

switches

symbols

syslinux

syslog

systemd

systemrescuecd

t1

tcpip

tcpwrappers

telnet

terminal

testdisk

tftp

thttpd

thunderbird

timezone

ting

tls

tools

tr

trac

tuning

tunnel

ubuntu

unbound

vi

vpn

wget

wiki

windows

windowsxp

wireless

wpa_supplicant

x

xauth

xfree86

xfs

xinearama

xmms

youtube

zdump

zeromq

zic

zlib