Check the below examples:
Code:
1.@ECHO OFF
2.
3.set varip=65.88.48.77
4.set varsm=255.255.255.224
5.set vargw=65.88.48.65
6.set vardns1=66.78.202.254
7.set vardns2=66.78.210.254
8.set varhome=www.google.com
9.
10.REM ***** You don’t need to change anything below this line! ******
11.
12.ECHO This fanciness is brought to you by Saman Sadeghi!
13.ECHO Setting IP Address and Subnet Mask
14.netsh int ip set address name = "Local Area Connection" source = static addr = %varip% mask = %varsm%
15.
16.ECHO Setting Gateway
17.netsh int ip set address name = "Local Area Connection" gateway = %vargw% gwmetric = 1
18.
19.ECHO Setting Primary DNS
20.netsh int ip set dns name = "Local Area Connection" source = static addr = %vardns1%
21.
22.ECHO Setting Secondary DNS
23.netsh int ip add dns name = "Local Area Connection" addr = %vardns2%
24.
25.ECHO Setting Internet Explorer Homepage to %varhome%
26.reg add "hkcusoftwaremicrosoftinternet explorermain" /v "Start Page" /d "%varhome%" /f
27.
28.ECHO Here are the new settings for %computername%:
29.netsh int ip show config
30.
31.pause
Bookmarks