System spam Cleanup can also be automated by simply creating a new batch and then adding it to the system startup to automate the boot, so that the system automatically runs the batch file every time it starts, cleaning up the system garbage.
Open Notepad, and then enter the following:
@echo off
Echo is cleaning up the system garbage file, please wait a moment ...
Del/f/s/q%systemdrive%*.tmp
Del/f/s/q%systemdrive%*._mp
Del/f/s/q%systemdrive%*.log
Del/f/s/q%systemdrive%*.gid
Del/f/s/q%systemdrive%*.chk
Del/f/s/q%systemdrive%*.old
Del/f/s/q%systemdrive%recycled*.*
Del/f/s/q%windir%*.bak
Del/f/s/q%windir%prefetch*.*
Rd/s/q%windir%temp &md%windir%temp
Del/f/q%userprofile%cookies*.*
Del/f/q%userprofile%recent*.*
del/f/s/q "%userprofile%local seteingstemporary Internet files*.*"
del/f/s/q "%userprofile%local seteingstemp*.*"
del/f/s/q "%userprofile%recent*.*"
echo Clears system garbage complete!
echo.& Pause
Select "File" → "Save As" when you are finished, and then enter "purge system garbage. bat" in "file name", but the filename does not matter, but the extension must be. bat. Click Save to make the batch file work.
Double-click on the batch file, you can quickly clean up the garbage file, about a minute or so. When the cleanup is complete, press any key to exit.