-
Notifications
You must be signed in to change notification settings - Fork 0
/
DHCP_or_static_toggle.bat
43 lines (36 loc) · 1.02 KB
/
DHCP_or_static_toggle.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
@echo off
cls
COLOR 2A
echo Notice: (right click on the script, click "Run As Administrator")
echo Written by Richard Thomas
echo Version 1.0 base
echo This version of the script is not ready for use,
echo to edit this script for use, replace data in line 23 with required info
echo and delete these lines from the script
echo Choose:
echo [1] Set Static IP
echo [2] Set DHCP
echo [3] Exit
echo.
:choice
SET /P C=[Select an option]
for %%? in (1) do if /I "%C%"=="%%?" goto A
for %%? in (2) do if /I "%C%"=="%%?" goto B
for %%? in (3) do if /I "%C%"=="%%?" goto end
goto choice
:A
echo "Setting Static IP Information"
netsh interface ip set address name="Local Area Connection" static <IP address> <subnet Mask> <Default Gateway>
netsh int ip show config
pause
goto end
:B
@ECHO OFF
ECHO Resetting IP Address and Subnet Mask For DHCP
netsh int ip set address name = "Local Area Connection" source = dhcp
ipconfig /renew
ECHO Here are the new settings for %computername%:
netsh int ip show config
pause
goto end
:end