-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwrn-fix-it-1.0.0.bat
378 lines (364 loc) · 9.12 KB
/
wrn-fix-it-1.0.0.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
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
rem =============================
rem WRN Fix IT - https://github.com/warengonzaga/wrn-fix-it#readme
rem Your Windows companion toolset for fixing common issues
rem Version: 1.0.0
rem Github: https://github.com/warengonzaga/wrn-fix-it
rem Licensed under GPL v3 - https://opensource.org/licenses/GPL-3.0
rem Copyright (c) 2023 Waren Gonzaga
rem
rem Facebook: @warengonzagaofficial
rem Twitter: @warengonzaga
rem Github: @warengonzaga
rem Website: warengonzaga.com
rem
rem Donate or Support!
rem https://buymeacoff.ee/warengonzaga
rem =============================
cls
@echo off
rem =============================
rem Setup Variables
rem =============================
set appname=WRN Fix IT
set appvers=1.0.0
set appstat=Alpha
set dev=Waren Gonzaga
set desc=Your Windows companion toolset for fixing common issues
set uicolor=a
set infouicolor=b
set erruicolor=c
set cliname=$%appname%
set divider======================================
title %appname% v%appvers% - %appstat%
rem =============================
rem Admin Permission Checker
rem =============================
@echo off
color %infouicolor%
echo Administrative permissions required. Detecting permissions.
ping localhost -n 2 >NUL
cls
echo Administrative permissions required. Detecting permissions..
ping localhost -n 2 >NUL
cls
echo Administrative permissions required. Detecting permissions...
ping localhost -n 2 >NUL
net session >nul 2>&1
if %errorLevel% == 0 (
echo Administrator privileges found!
echo Starting the program...
ping localhost -n 2 >NUL
goto mainMenu
) else (
cls
color %erruicolor%
echo # %divider%
echo # %appname% v%appvers% - %appstat%
echo # by %dev%
echo # %divider%
echo #
echo # ERROR * ERROR * ERROR * ERROR * ERROR * ERROR
echo #
echo # Current user permissions to execute this .bat file are inadequate.
echo # This .bat file must be run with administrative privileges.
echo # Close this program and run it as administrator.
echo # Contact the developer to assist you...
echo #
echo # ERROR * ERROR * ERROR * ERROR * ERROR * ERROR
echo #
pause
exit
)
rem =============================
rem Main Menu
rem =============================
:mainMenu
cls
title %appname% v%appvers% - %appstat% [Main Menu]
echo # %divider%
echo # %appname% v%appvers% - %appstat%
echo # by %dev%
echo # %divider%
color %uicolor%
echo # %desc%
echo # %divider%
echo #
echo # Tools ...................... [1] (enter)
echo # Modules .................... [2] (coming soon)
echo # Donate ..................... [3]
echo # Exit ....................... [4]
echo #
set/p "mainMenu=# %cliname%> " || set mainMenu=1
if %mainMenu%==1 goto toolsMenu
if %mainMenu%==2 goto modulesMenu
if %mainMenu%==3 goto donate
if %mainMenu%==4 || if %mainMenu%==exit goto exitProgram
goto err2
pause>null
rem =============================
rem Tools Menu
rem =============================
:toolsMenu
del null
cls
title %appname% v%appvers% - %appstat% [Tools]
color %uicolor%
echo # %divider%
echo # %appname% v%appvers% - %appstat%
echo # by %dev%
echo # %divider%
echo #
echo # DNS Server Changer ......... [1]
echo # Back to Main Menu .......... [2] (enter)
echo #
set/p "toolsMenu=# %cliname%> " || set toolsMenu=2
if %toolsMenu%==1 goto t001
if %toolsMenu%==2 goto mainMenu
goto err2
pause>null
rem =============================
rem Tools: DNS Server Changer
rem =============================
:t001
del null
cls
title %appname% v%appvers% - %appstat% [DNS Server Changer]
color %uicolor%
echo # %divider%
echo # %appname% v%appvers% - %appstat%
echo # by %dev%
echo # %divider%
echo #
echo # Default / DHCP ............. [0]
echo # Google DNS ................. [1]
echo # Cloudflare DNS ............. [2]
echo # Freenome DNS ............... [3]
echo # Comodo DNS ................. [4]
echo # Quad9 DNS .................. [5]
echo # Verisign DNS ............... [6]
echo # OpenDNS .................... [7]
echo # Back ....................... [8] (enter)
echo #
set/p "t001_option=# %cliname%> " || set t001_option=4
rem some algo
if %t001_option% equ 0 (
rem default / dhcp
set t001_d0=1
goto t001_1
)
if %t001_option% equ 1 (
rem Google Public DNS
set t001_d0=0
set t001_d1=8.8.8.8
set t001_d2=8.8.4.4
goto t001_1
)
if %t001_option% equ 2 (
rem Cloudflare DNS
set t001_d0=0
set t001_d1=1.1.1.1
set t001_d2=1.0.0.1
goto t001_1
)
if %t001_option% equ 7 (
rem Freenom DNS
set t001_d0=0
set t001_d1=80.80.80.80
set t001_d2=80.80.81.81
goto t001_1
)
if %t001_option% equ 4 (
rem Comodo Secure DNS
set t001_d0=0
set t001_d1=8.26.56.26
set t001_d2=8.20.247.20
goto t001_1
)
if %t001_option% equ 5 (
rem Quad9 DNS
set t001_d0=0
set t001_d1=9.9.9.9
set t001_d2=149.112.112.112
goto t001_1
)
if %t001_option% equ 6 (
rem Verisign DNS
set t001_d0=0
set t001_d1=64.6.64.6
set t001_d2=64.6.65.6
goto t001_1
)
if %t001_option% equ 7 (
rem OpenDNS
set t001_d0=0
set t001_d1=208.67.222.222
set t001_d2=208.67.220.220
goto t001_1
)
if %t001_option% equ 8 goto toolsMenu
goto err2
pause>null
rem =============================
rem Tools: DNS Server Changer
rem =============================
:t001_1
del null
cls
title %appname% v%appvers% - %appstat% [DNS Server Changer]
color %uicolor%
echo # %divider%
echo # %appname% v%appvers% - %appstat%
echo # by %dev%
echo # %divider%
echo # Select the network you want to change the DNS server.
echo # Note: Interface names are case-sensitive.
echo # %divider%
netsh interface ip show config
echo # %divider%
echo #
set/p "t001_2_option=# %cliname%> " || goto err2
echo #
echo # Updating ...
netsh interface ip set dnsservers "%t001_2_option%" dhcp
if %errorlevel% neq 1 (
if %t001_d0%==0 netsh interface ip set dnsservers "%t001_2_option%" static %t001_d1% primary
if %t001_d0%==0 netsh interface ip add dnsservers "%t001_2_option%" %t001_d2% index=2
) else (
goto err3
)
cls
title %appname% v%appvers% - %appstat% [DNS Server Changer]
color %uicolor%
echo # %divider%
echo # %appname% v%appvers% - %appstat%
echo # by %dev%
echo # %divider%
echo #
echo # DNS Server successfuly changed!
echo #
echo # %divider%
echo #
echo # Press any key to continue... (except power button lol)
pause>null
goto toolsMenu
rem =============================
rem Modules Menu
rem =============================
:modulesMenu
del null
cls
title %appname% v%appvers% - %appstat% [Not Available]
color %uicolor%
echo # %divider%
echo # %appname% v%appvers% - %appstat%
echo # by %dev%
echo # %divider%
echo # Currently not available!
echo # %divider%
echo #
echo # Press any key to continue... (except power button lol)
pause>null
goto mainMenu
rem =============================
rem Donation
rem =============================
:donate
del null
cls
title %appname% v%appvers% - %appstat% [Donate]
echo # %divider%
echo # %appname% v%appvers% - %appstat%
echo # by %dev%
echo # %divider%
color %uicolor%
echo # Donate and Support
echo # %divider%
echo #
echo # Do you like this tool?
echo # Please consider to buy me a coffee or
echo # just donate to keep this project alive.
echo #
echo # Buy Me A Coffee ............ [1]
echo # GitHub Sponsors ............ [2]
echo # Back to Main Menu .......... [3] (enter)
echo #
set /p "donate=# %cliname%> " || set donate=3
if %donate%==1 goto buymeacoffee
if %donate%==2 goto sponsors
if %donate%==3 goto mainMenu
goto err2
pause>null
rem =============================
rem Donation: BMC
rem =============================
:buymeacoffee
start https://buymeacoff.ee/warengonzaga
goto donate
rem =============================
rem Donation: GitHub Sponsors
rem =============================
:sponsors
start https://github.com/sponsors/warengonzaga
goto donate
rem =============================
rem Error 1 Message Screen
rem =============================
:err1
cls
title %appname% v%appvers% - %appstat% [Error Code 1]
echo # %divider%
echo # %appname% v%appvers% - %appstat%
echo # by %dev%
echo # %divider%
color %erruicolor%
echo #
echo # ERROR * ERROR * ERROR * ERROR * ERROR * ERROR
echo #
echo # You input an invalid entry please use the specified options.
echo #
echo # ERROR * ERROR * ERROR * ERROR * ERROR * ERROR
echo #
pause>null
goto mainMenu
rem =============================
rem Error 2 Message Screen
rem =============================
:err2
del null
cls
title %appname% v%appvers% - %appstat% [Error Code 2]
color %erruicolor%
echo # %divider%
echo # %appname% v%appvers% - %appstat%
echo # by %dev%
echo # %divider%
echo # Invalid option! Please try again...
echo # %divider%
echo #
echo # Press any key to continue... (except power button lol)
pause>null
goto mainMenu
rem =============================
rem Error 2 Message Screen
rem =============================
:err3
del null
cls
title %appname% v%appvers% - %appstat% [Error Code 3]
color %erruicolor%
echo # %divider%
echo # %appname% v%appvers% - %appstat%
echo # by %dev%
echo # %divider%
echo # The selected network doesn't exist!
echo # Keep in mind that the network names are case sensitive.
echo # %divider%
echo #
echo # Press any key to continue... (except power button lol)
pause>null
goto mainMenu
rem =============================
rem Exit Option Function
rem =============================
:exitProgram
exit