Set IP Address and Subnet Mask using batch file

1.@ECHO OFF
2.
3.set varip=xxx.xxx.xxx.xxx
4.set varsm=xxx.xxx.xxx.xxx
5.set vargw=xxx.xxx.xxx.xxx
6.set vardns1=xxx.xxx.xxx.xxx
7.set vardns2=xxx.xxx.xxx.xxx
8.set varhome=www.google.com
9.
10.ECHO Setting IP Address and Subnet Mask
11.netsh int ip set address name = "Local Area Connection" source = static addr = %varip% mask = %varsm%
12.
13.ECHO Setting Gateway
14.netsh int ip set address name = "Local Area Connection" gateway = %vargw% gwmetric = 1
15.
16.ECHO Setting Primary DNS
17.netsh int ip set dns name = "Local Area Connection" source = static addr = %vardns1%
18.
19.ECHO Setting Secondary DNS
20.netsh int ip add dns name = "Local Area Connection" addr = %vardns2%
21.
22.ECHO Setting Internet Explorer Homepage to %varhome%
23.reg add "hkcusoftwaremicrosoftinternet explorermain" /v "Start Page" /d "%varhome%" /f
24.
25.ECHO Here are the new settings for %computername%:
26.netsh int ip show config
27.
28.pause

Advertisements

One Response to Set IP Address and Subnet Mask using batch file

  1. Pingback: Set IP Address and Subnet Mask using batch file « Guo'z Space | IP address.co.uk

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s