-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSupercommand
More file actions
56 lines (51 loc) · 2.04 KB
/
Copy pathSupercommand
File metadata and controls
56 lines (51 loc) · 2.04 KB
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
@echo off
Echo Started %time%
MD C:\cleartmp
Echo Started %time% >> c:\cleartmp\temps.txt
Echo Running for XP... >> c:\cleartmp\temps.txt
Echo Running for XP...
c:
cd\
cd "documents and settings"
FOR /F "tokens=*" %%G IN ('DIR c:\docume~1 /B /AD') DO IF EXIST "%%G\Local Settings\Temp\" (
DEL /S /Q "%%G\Local Settings\Temp"
RMDIR /S /Q "%%G\Local Settings\Temp"
MKDIR "%%G\Local Settings\Temp"
Echo Cleared %%G\Local Settings\Temp
Echo Cleared %%G\Local Settings\Temp >> c:\cleartmp\temps.txt
)
FOR /F "tokens=*" %%G IN ('DIR c:\docume~1 /B /AD') DO IF EXIST "%%G\Local Settings\Temporary Internet Files\" (
DEL /S /Q "%%G\Local Settings\Temporary Internet Files\"
RMDIR /S /Q "%%G\Local Settings\Temporary Internet Files\"
MKDIR "%%G\Local Settings\Temporary Internet Files\"
Echo Cleared %%G\Local Settings\Temporary Internet Files\
Echo Cleared %%G\Local Settings\Temporary Internet Files\ >> c:\cleartmp\temps.txt
)
Echo Done.
Echo Running for Vista >> c:\cleartmp\temps.txt
Echo Running for Vista...
c:
cd\
cd Users
FOR /F "tokens=*" %%G IN ('DIR c:\users /B /AD') DO IF EXIST "%%G\AppData\Local\Temp\" (
DEL /S /Q "%%G\AppData\Local\Temp\"
RMDIR /S /Q "%%G\AppData\Local\Temp\"
MKDIR "%%G\AppData\Local\Temp\"
Echo Cleared %%G\AppData\Local\Temp\
Echo Cleared %%G\AppData\Local\Temp\ >> c:\cleartmp\temps.txt
)
FOR /F "tokens=*" %%G IN ('DIR c:\users /B /AD') DO IF EXIST "%%G\AppData\Local\Microsoft\Windows\Temporary Internet Files\" (
DEL /S /Q "%%G\AppData\Local\Microsoft\Windows\Temporary Internet Files\"
RMDIR /S /Q "%%G\AppData\Local\Microsoft\Windows\Temporary Internet Files\"
MKDIR "%%G\AppData\Local\Microsoft\Windows\Temporary Internet Files\"
Echo Cleared %%G\Local Settings\Temporary Internet Files\
Echo Cleared %%G\Local Settings\Temporary Internet Files\ >> c:\cleartmp\temps.txt
)
Echo Done.
Echo Clearing Windows Temp Directory...
Echo Clearing Windows Temp Directory >> c:\cleartmp\temps.txt
del /s /q %windir%\temp
rm /s /q %windir%\temp
md %windir%\temp
Echo Ended %time%
Echo Ended %time% >> c:\cleartmp\temps.txt