TUT, Prevent malware/Autoclean it

DoxThis

Level 3
Thread author
Verified
Apr 25, 2015
135
216
166
1.Create a .txt file with this inside, then save as anything.bat (Make sure you enable all saving as any file type)
@echo off
del "%TEMP%\*.*" /s /f /q
for /d %%d in (%TEMP%\*) do rmdir "%%d" /s /q
del "%WINDIR%\TEMP\*.*" /s /f /q
for /d %%d in (%WINDIR%\TEMP\*) do rmdir "%%d" /s /q
pause
2. Hit windows key and r, type shell:starup, Drag and drop the bat inside
3. Profit from malware that infect the temp folder
* This will obviously not clean registry etc. It only helps to stop malware that extract to temp
Thanks for the help Nico!

 
Last edited:
  • Like
Reactions: FireShootSK
Could you explain what this batch file provides?

What about legitimate programs that use the temp folders?
 
Code:
rd %temp% /s /q
md %temp%
Hit Windows key and R then type: shell:startup
You forgot the T.

However you might as well use this:

Code:
@echo off
del "%TEMP%\*.*" /s /f /q
for /d %%d in (%TEMP%\*) do rmdir "%%d" /s /q
del "%WINDIR%\TEMP\*.*" /s /f /q
for /d %%d in (%WINDIR%\TEMP\*) do rmdir "%%d" /s /q
pause

This will mostly clean your temp files.
Yet make sure you run them as admin, because otherwise you get file in use/ or permission errors. That said next time you provide a code write what it does and put it in code tags.

Cheers
 
Last edited:
  • Like
Reactions: FireShootSK
Could you explain what this batch file provides?

What about legitimate programs that use the temp folders?

TEMP files by legit programs pile up overtime, there are only a few programs that actually clean them up properly, but usually TEMP folders fill up overtime without being cleaned properly and if legit files are being deleted, then their parent program will regenerate them when needed.
So usually this can be done without risk. YET a note of caution: If you do not know what you are doing then do not use this option and stick to basic windows tools, or proven third party programs like CCleaner, Privazer, Glary tools.

Cheers
 
TEMP files by legit programs pile up overtime, there are only a few programs that actually clean them up properly, but usually TEMP folders fill up overtime without being cleaned properly and if legit files are being deleted, then their parent program will regenerate them when needed.
So usually this can be done without risk. YET a note of caution: If you do not know what you are doing then do not use this option and stick to basic windows tools, or proven third party programs like CCleaner, Privazer, Glary tools.

Cheers
Thanks I was on my phone and very tired and I just wanted a post
 
TEMP files by legit programs pile up overtime, there are only a few programs that actually clean them up properly, but usually TEMP folders fill up overtime without being cleaned properly and if legit files are being deleted, then their parent program will regenerate them when needed.
So usually this can be done without risk. YET a note of caution: If you do not know what you are doing then do not use this option and stick to basic windows tools, or proven third party programs like CCleaner, Privazer, Glary tools.

Cheers
ATF cleaner does a great job, it cleans alot that ccleaner misses