-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPowerToolsCMD.bat
285 lines (247 loc) · 10.2 KB
/
PowerToolsCMD.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
::
:: © Maybe Ange™ Corporation - All rights reserved.
::
:: This website is protected by copyright laws and is the property of Maybe Ange™ Corporation.
:: Any reproduction, modification, distribution or exploitation of all or part of the content of this site, in any form whatsoever, without prior written authorization, is strictly prohibited.
:: For any request for authorization or to obtain additional information on the rights to use the content of this site, please contact us via https://maybe-ange.com/#contact
::
:: License: CC-BY-ND-4.0
::
@echo off
net session >nul 2>&1
if %errorlevel% neq 0 (
echo.
echo ^***************************************************^*
echo ^* ^*
echo ^* Attention: You need to run this script ^*
echo ^* as an administrator. ^*
echo ^* Please restart the script as ^*
echo ^* an administrator. ^*
echo ^* ^*
echo ^***************************************************^*
echo.
pause
exit /b
)
setlocal enabledelayedexpansion
cls
:start
echo.
echo ^+---------------------------------------------^+
echo ^| Welcome to My Script ^|
echo ^+---------------------------------------------^+
echo ^| Developer: DURAND Jimmy ^|
echo ^| Org: Maybe Ange Corporation ^|
echo ^+---------------------------------------------^+
echo.
echo Please note, CURL is required to have access to all features.
echo.
set /p show_ip=Do you want to display your Public IP Address? (Y/N):
cls
:menu
cls
echo.
echo %date%
echo.
echo Computer: %computername% --- User: %username%
if /i "%show_ip%"=="Y" (
for /f "delims=" %%i in ('powershell -Command "(Invoke-WebRequest -Uri 'https://api.ipify.org' -UseBasicParsing).Content"') do (
set "ipaddress=%%i"
)
) else (
set ipaddress=Hidden ***.***.***.***
)
for /f "tokens=*" %%i in ('curl -s ipinfo.io/org') do (
set "provider=%%i"
)
reg query "HKLM\SYSTEM\CurrentControlSet\Services\USBSTOR" /v "Start" | findstr /i "Start" >nul
if %errorlevel% equ 0 (
for /f "tokens=3" %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Services\USBSTOR" /v "Start" ^| findstr /i "Start"') do (
if %%a equ 3 (
set USBStatus=Enabled
) else if %%a equ 4 (
set USBStatus=Disabled
)
)
)
echo.
echo IP Address: %ipaddress%
echo Internet Provider: %provider%
echo.
echo ^+---------------------------------------------^+
echo ^| TASK MENU ^|
echo ^+---------------------------------------------^+
echo ^| 1. Empty Recycle Bin ^|
echo ^| 2. Control Panel ^|
echo ^| 3. System Information ^|
echo ^| 4. Internet Speed Test ^|
echo ^| 5. Install VLC ^|
echo ^| 6. Disable USB ports ^|
echo ^| 7. Apps update ^|
echo ^| 8. Exit ^|
echo ^+---------------------------------------------^+
echo.
set /p option= Choose an option:
if %option% equ 1 goto option1
if %option% equ 2 goto option2
if %option% equ 3 goto option3
if %option% equ 4 goto option4
if %option% equ 5 goto option5
if %option% equ 6 goto option6
if %option% equ 7 goto option7
if %option% equ 8 goto end
if %option% GEQ 9 goto optionerror
:option1
cls
echo.
echo ^+---------------------------------------------^+
echo ^| Recycle Bin Emptied ^|
echo ^+---------------------------------------------^+
echo.
echo Please Wait, Deleting Trash in Progress...
for /l %%i in (60,1,100) do (
cls
echo.
echo ^+---------------------------------------------^+
echo ^| Recycle Bin Emptied ^|
echo ^+---------------------------------------------^+
echo.
echo Please Wait, Deleting Trash in Progress...
echo Progress: %%i%%
timeout /t 0 /nobreak > NUL
)
rd /S /Q c:\$Recycle.bin
pause
goto menu
:option2
cls
echo.
echo ^+---------------------------------------------^+
echo ^| Control Panel Opened ^|
echo ^+---------------------------------------------^+
echo.
control.exe
pause
goto menu
:option3
cls
echo Retrieving System Information...
echo Please Wait...
timeout /t 5 /nobreak > NUL
systeminfo
pause
goto menu
:option4
cls
echo.
echo ^+---------------------------------------------^+
echo ^| Welcome to Internet Speedtest ^|
echo ^| ^|
echo ^| Running Internet Speed Test... ^|
echo ^+---------------------------------------------^+
echo.
echo API CURL: speedtest.tele2.net
echo.
curl -o NUL http://speedtest.tele2.net/100MB.zip
pause
goto menu
:option5
cls
echo.
echo ^+---------------------------------------------^+
echo ^| Install VLC ^|
echo ^+---------------------------------------------^+
echo.
echo Installation by CMD, may be refused by antivirus.
set /p vlc=Do you want to install VLC? (Y/N):
if /i "%vlc%"=="Y" (
echo Downloading the VLC installer...
certutil -urlcache -split -f "https://get.videolan.org/vlc/3.0.16/win64/vlc-3.0.16-win64.exe" "%TEMP%\vlc-3.0.16-win64.exe"
echo Installing VLC...
"%TEMP%\vlc-3.0.16-win64.exe" /S
echo.
echo Installation Completed.
) else (
echo Installation Cancel.
)
pause
goto menu
:option6
cls
echo.
echo ^+---------------------------------------------^+
echo ^| Disable USB ports ^|
echo ^+---------------------------------------------^+
echo.
echo 1. Disable USB ports
echo 2. Enable USB ports
echo 3. Back
echo.
set /p choice="Enter the number of your choice: "
if "%choice%"=="1" goto disable_usb_ports
if "%choice%"=="2" goto enable_usb_ports
if "%choice%"=="3" goto menu
echo Invalid choice. Try Again.
pause
goto menu
:disable_usb_ports
reg add "HKLM\SYSTEM\CurrentControlSet\Services\USBSTOR" /v "Start" /t REG_DWORD /d 4 /f >nul
echo USB ports have been successfully disabled.
pause
goto menu
:enable_usb_ports
reg add "HKLM\SYSTEM\CurrentControlSet\Services\USBSTOR" /v "Start" /t REG_DWORD /d 3 /f >nul
echo The USB ports have been successfully activated.
pause
goto menu
:option7
cls
echo.
echo ^+---------------------------------------------^+
echo ^| TASK MENU ^|
echo ^+---------------------------------------------^+
echo ^| 1. Check Update ^|
echo ^| 2. Update Now ^|
echo ^| 3. Back ^|
echo ^+---------------------------------------------^+
echo.
set /p updateOption= Choose an option:
if %updateOption% equ 1 goto checkUpdate
if %updateOption% equ 2 goto updateNow
if %updateOption% equ 3 goto menu
echo Invalid choice. Try Again.
:checkUpdate
cls
echo.
echo ^+---------------------------------------------^+
echo ^| Check Update ^|
echo ^+---------------------------------------------^+
echo.
echo Checking for updates available...
winget update
pause
goto option7
:updateNow
cls
echo.
echo ^+---------------------------------------------^+
echo ^| Check Update ^|
echo ^+---------------------------------------------^+
echo.
echo Installing updates...
winget update --all
pause
goto option7
pause
goto menu
:optionerror
cls
echo.
echo ^+---------------------------------------------^+
echo ^| Invalid Option! Choose from Menu ^|
echo ^+---------------------------------------------^+
echo.
pause
goto menu
:end
cls