-
Notifications
You must be signed in to change notification settings - Fork 0
/
execute.cmd
127 lines (97 loc) · 3.35 KB
/
execute.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
123
124
125
126
127
@echo off
:: BatchGotAdmin
:-------------------------------------
REM --> Check for permissions
>nul 2>&1 "%SYSTEMROOT%\system32\icacls.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 args = "" >> "%temp%\getadmin.vbs"
echo For Each strArg in WScript.Arguments >> "%temp%\getadmin.vbs"
echo args = args ^& strArg ^& " " >> "%temp%\getadmin.vbs"
echo Next >> "%temp%\getadmin.vbs"
echo UAC.ShellExecute "%~s0", args, "", "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"
:--------------------------------------
call config.cmd
:MENU
cls
netsh interface ipv4 show config %INTERFACENAME%
ECHO ...............................................
ECHO CONFIGURACOES DE REDE FACILITADAS
ECHO ...............................................
ECHO 1 - SET IP FIXO %IP1% DNS DHCP
ECHO 2 - SET IP FIXO %IP2% DNS DHCP
ECHO 3 - SET IP FIXO %IP3% DNS DHCP
ECHO 4 - SET IP e DNS DHCP
ECHO 5 - SET IP DHCP e GOOGLE DNS (8.8.8.8)
ECHO 6 - SET IP FIXO %IP1% e GOOGLE DNS (8.8.8.8)
ECHO 7 - SET IP FIXO %IP2% e GOOGLE DNS (8.8.8.8)
ECHO 8 - SET IP FIXO %IP3% e GOOGLE DNS (8.8.8.8)
ECHO 9 - REFRESH
ECHO 0 - EXIT
ECHO
ECHO email: [email protected]
SET /P M=ESCOLHA A OPCAO:
IF %M%==1 GOTO IP1
IF %M%==2 GOTO IP2
IF %M%==3 GOTO IP3
IF %M%==4 GOTO DHCP1
IF %M%==5 GOTO DHCP2
IF %M%==6 GOTO IP1G
IF %M%==7 GOTO IP2G
IF %M%==8 GOTO IP3G
IF %M%==9 GOTO MENU
IF %M%==0 GOTO EOF
:IP1
::set static IP1
echo "setting ip1"
netsh interface ipv4 set address name=%INTERFACENAME% static %IP1% %MASCARA1% %GW1%
netsh interface ipv4 set dnsservers name=%INTERFACENAME% source=dhcp
GOTO MENU
:IP2
::set static IP2
netsh interface ipv4 set address name=%INTERFACENAME% static %IP2% %MASCARA2% %GW2%
netsh interface ipv4 set dnsservers name=%INTERFACENAME% source=dhcp
GOTO MENU
:IP3
::set static IP3
netsh interface ipv4 set address name=%INTERFACENAME% static %IP3% %MASCARA3% %GW3%
netsh interface ipv4 set dnsservers name=%INTERFACENAME% source=dhcp
GOTO MENU
:DHCP1
::Set DHCP e DNSDHCP
netsh interface ipv4 set address name=%INTERFACENAME% source=dhcp
netsh interface ipv4 set dnsservers name=%INTERFACENAME% source=dhcp
GOTO MENU
:DHCP2
::Set DHCP E GOOGLE
netsh interface ipv4 set address name=%INTERFACENAME% source=dhcp
netsh interface ipv4 set dns name=%INTERFACENAME% static 8.8.8.8
GOTO MENU
:IP1G
::set static IP1
netsh interface ipv4 set address name=%INTERFACENAME% static %IP1% %MASCARA1% %GW1%
netsh interface ipv4 set dns name=%INTERFACENAME% static 8.8.8.8
GOTO MENU
:IP2G
::set static IP2
netsh interface ipv4 set address name=%INTERFACENAME% static %IP2% %MASCARA2% %GW2%
netsh interface ipv4 set dns name=%INTERFACENAME% static 8.8.8.8
GOTO MENU
:IP3G
::set static IP3
netsh interface ipv4 set address name=%INTERFACENAME% static %IP3% %MASCARA3% %GW3%
netsh interface ipv4 set dns name=%INTERFACENAME% static 8.8.8.8
GOTO MENU
:EOF
echo "Fechando!"