-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path3663 IP Switch.cmd
122 lines (107 loc) · 3.52 KB
/
3663 IP Switch.cmd
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
@echo off
title 3663 IP Switch
Color B
::----Thank You---http://www.cammckenzie.com/-----For Your Code-----------------------------------------------------------------------------
::REM --> Check for permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
::REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
echo Requesting administrative privileges...
goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
exit /B
:gotAdmin
if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
pushd "%CD%"
CD /D "%~dp0"
::------------------------------------------------------------------------------------------------------
if exist "C:\IpSwitchTemp.txt" goto :start
goto :NetName
:NetName
set /p NetName="Please enter the name of the network adapter you wish to edit:"
echo %NetName% > C:\IpSwitchTemp.txt
:start
cls
FOR /f "tokens=14 delims= " %%a IN ('IPCONFIG ^| FINDSTR IPv4') DO (
SET ip=%%a
)
set /p NetName=<C:\IpSwitchTemp.txt
cls
echo ////////////////////////////////////////////
echo * TEAM 3663 IP SWITCH *
echo * BY: *
echo * TYLER DOMITROVICH *
echo ////////////////////////////////////////////
echo *------------------------------------------*
echo *-----------Your-Current-IP-Is:------------*
echo * %ip%
echo * %NetName%
echo *------------------------------------------*
echo *------------------MENU--------------------*
echo *------------1-Set Static IP---------------*
echo *------------2-Reset to DHCP---------------*
echo *------------3-Set Network Connection Name-*
echo *------------4-Exit------------------------*
echo *------------------------------------------*
set /p Choice=Make Selection:
if %Choice%==1 goto SetStaticIP
if %Choice%==2 goto SetDHCP
if %Choice%==3 goto SetNetName
if %Choice%==4 EXIT
cls
echo Invalid Selection. Please Choose One Of The Listed Options
pause
goto start
:SetStaticIP
cls
set ip=
echo Please Enter a Number Between 5 and 100 That Nobody Else Has Chosen:
set /P NUM=""
set STATIC_IP=10.36.63.%NUM%
netsh interface ip set address name="Wireless Network Connection" static %STATIC_IP% 255.0.0.0 10.36.63.1
::echo %NetName%
if errorlevel 0 (echo Your IP is now ^set to %STATIC_IP%)
if errorlevel 2 (goto ERROR)
set ip=%STATIC_IP%
pause
goto start
:SetDHCP
cls
set ip=
netsh interface ip set address name="Wireless Network Connection" source=dhcp
if errorlevel 0 (echo You Are Now Using DHCP!)
if errorlevel 2 (goto ERROR)
pause
goto start
:SetNetName
cls
echo Please Enter the Name of Your Network Connection
set /p NetworkName=
echo Network Name Saved
pause
goto start
:ERROR
cls
echo An error occured. Try running this as admin and check the name of your network connnection.
echo This program will now close. Peace Out!
echo --------------------------------------------------------------------------------
echo ."". ."",
echo ^| ^| / /
echo ^| ^| / /
echo ^| ^| / /
echo ^| ^|/ ;-._
echo } ` _/ / ;
echo ^| /` ) / /
echo ^| / /_/\_/\
echo ^|/ / ^|
echo ( ' \ '- ^|
echo \ `. /
echo ^| ^|
echo ^| ^|
echo -------------------------------------------------------------------------------
pause
Exit