This repository has been archived by the owner on Mar 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBatchTempMaster.bat
188 lines (170 loc) · 6.73 KB
/
BatchTempMaster.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
@echo off
color 3
title BatchTempMaster - By AzizJaber#1616
:loading
for /f "delims=" %%x in (config.txt) do (set "%%x")
color %color%
title BatchTempMaster %version% - By AzizJaber#1616
setlocal enableextensions enabledelayedexpansion
set "CR=" & for /f %%a in ('copy /Z "%~f0" nul') do if not defined CR set "CR=%%a"
set "fill=[#####]"
cls
ECHO =========================================================================
ECHO LOADING SETTINGS FROM (config.txt), PLEASE WAIT A FEW SECOUNDS...
ECHO =========================================================================
ECHO.
ECHO REMOVE CONFIRM: %needconfirm% - SHOW CONFIRM BEFORE CONTINUE SCREEN
ECHO.
ECHO CMD COLOR: %color% - THE CMD TEXT COLOR
ECHO.
ECHO CURRENT VERSION: %version% - SCRIPT VERSION
ECHO.
ECHO =========================================================================
ECHO NOTE: FOR BETTER RESULT, OPEN THIS SCRIPT WITH ADMIN PERMISSION !!
ECHO.
ECHO CHECK FOR SCRIPT UPDATES HERE: github.com/azizmjaber02/batch-temp-master
ECHO =========================================================================
ECHO.
for /l %%a in (2 1 5) do (
set "spaces=!fill:~%%a!"
<nul set/p ".=Getting Everything Ready !fill:~0,%%a!!spaces:#= !!CR!"
ping -n 2 "" > nul
)
ECHO(
ECHO(Loading Done...
if %needconfirm%==false goto start
if %needconfirm%==true goto confirm
:confirm
cls
title BatchTempMaster %version% - Confirm Remove Before Continue
ECHO ================================================================================
ECHO FOLDERS/ACTIONS WITH (true) WILL BE FULLY REMOVED/RUN (NO RETURN !!)
ECHO.
ECHO FOLDERS/ACTIONS WITH (false) WILL BE IGNORED (NOTHING WILL BE REMOVED/RUN)
ECHO ================================================================================
ECHO TEMP1: %temp1% - %USERPROFILE%\AppData\Local\Temp
ECHO.
ECHO TEMP2: %temp2% - %windir%\Temp
ECHO.
ECHO DISCORD CACHE: %discord_cache% - SPEED UP DISCORD BY REMOVING LOCAL CACHE FILES
ECHO.
ECHO LOG FILES: %logfiles% - REMOVE ALL FILES WITH *.LOG EXTENTION
ECHO.
ECHO PREFETCH: %prefetch% - %windir%\Prefetch
ECHO ================================================================================
ECHO NOTE: PLEASE MAKE SURE TO CLOSE EVERYTHING THAT YOU DONT USE/NEED RIGHT NOW!
ECHO ================================================================================
ECHO.
pause
cls
goto start
:start
cls
title BatchTempMaster %version% - Please Wait This May Take Long Time
ECHO ==========================================================================================
ECHO BatchTempMaster %version% - REMOVING TEMPORARY FOLDERS/FILES... THIS MAY TAKE LONG TIME
ECHO ==========================================================================================
ECHO MESSAGE: The process cannot access the file because it is being used by another process.
ECHO NOTE: IF THIS MESSAGE APPEARS THATS NORMAL... SOME FOLDERS/FILES CANT BE DELETED (IN-USE)
ECHO ==========================================================================================
ECHO.
@echo
if %temp1%==true (
cd /D %temp%
for /d %%D in (*) do rd /s /q "%%D"
del /f /q *
ECHO.
ECHO ========================================================================
ECHO TEMP1: %USERPROFILE%/AppData/Local/Temp - DONE
ECHO ========================================================================
ECHO.
) Else (
ECHO.
ECHO ========================================================================
ECHO TEMP1: %USERPROFILE%/AppData/Local/Temp - SKIPPED
ECHO ========================================================================
ECHO.
)
if %temp2%==true (
cd /D %windir%/temp
for /d %%D in (*) do rd /s /q "%%D"
del /f /q *
ECHO.
ECHO ========================================================================
ECHO TEMP2: %windir%/temp - DONE
ECHO ========================================================================
ECHO.
) Else (
ECHO.
ECHO ========================================================================
ECHO TEMP2: %windir%/temp - SKIPPED
ECHO ========================================================================
ECHO.
)
if %discord_cache%==true (
cd "%APPDATA%/Discord/Cache"
del /S *.*
cd "%APPDATA%/Discord/Code Cache"
del /S *.*
cd "%APPDATA%/Discord/GPUCache"
del /S *.*
ECHO.
ECHO ========================================================================
ECHO DISCORD CACHE: %APPDATA%/Discord/Cache - DONE
ECHO ========================================================================
ECHO.
) Else (
ECHO.
ECHO ========================================================================
ECHO DISCORD CACHE: %APPDATA%/Discord/Cache - SKIPPED
ECHO ========================================================================
ECHO.
)
if %logfiles%==true (
cd/
del *.log /a /s /q /f
ECHO.
ECHO ========================================================================
ECHO REMOVE ALL FILES WITH *.LOG EXTENTION - DONE
ECHO ========================================================================
ECHO.
) Else (
ECHO.
ECHO ========================================================================
ECHO REMOVE ALL FILES WITH *.LOG EXTENTION - SKIPPED
ECHO ========================================================================
ECHO.
)
if %prefetch%==true (
cd /D %windir%\Prefetch
for /d %%D in (*) do rd /s /q "%%D"
del /f /q *
ECHO.
ECHO ========================================================================
ECHO PREFETCH: %windir%/Prefetch - DONE
ECHO ========================================================================
ECHO.
) Else (
ECHO.
ECHO ========================================================================
ECHO PREFETCH: %windir%/Prefetch - SKIPPED
ECHO ========================================================================
ECHO.
)
pause
cls
goto finish
:finish
@echo off
cls
title BatchTempMaster %version% - Everything Done
ECHO ========================================================================
ECHO BatchTempMaster %version% - SCRIPT BY: AzizJaber#1616
ECHO ========================================================================
ECHO EVERYTHING DONE... HAVE NICE DAY %username% ;)
ECHO CHECK FOR SCRIPT UPDATES HERE: github.com/azizmjaber02/batch-temp-master
ECHO ========================================================================
ECHO NOTE: RESTART YOUR PC AFTER THIS IS OPTIMAL THING..
ECHO ========================================================================
ECHO.
pause