Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Windows Tip-cleaning up system garbage when shutting down

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Although garbage cleaning is a "clich é" thing, because I don't like housekeeper and other kit tools, I also feel that cleaning and maintenance tools such as CCleaner, FCleaner, Glary Utilities and so on are cumbersome to install, crack, click to clean and so on. So, in the end, we returned to the old way of cleaning up garbage by bat batch processing. This paper simply collates and records the realization of automatically calling batch files to clean up the garbage of the system when shutting down.

Junk files generated during installation and use of Windows: temporary files (e.g. .tmp,. _ mp, etc.) temporary backup files (e.g. .bak, .old, * .syd, etc.) temporary help files (* .gid) disk check data files (* .chk) .dir, .dmp, * .nch and other temporary files

Use rubbish such as software:

The playback records of players such as Storm Player and iqiyi, the use records of office software such as office, etc., records of 00:00 files generated during the use of QQ, WeChat, etc., records of other software applications, and other garbage used by browsers: Cookies history (including address bar history), various password form accounts, offline cache files (pictures), various search records, etc. Batch files for cleaning up system garbage

There are a lot of batch codes on the Internet about cleaning up system garbage, here is a reference.

@ echo offecho-echo empties the COOKIES and IE temporary file directories... rem del / f / Q% userprofile%\ COOKIES s\ *. * rem del / f / Q% userprofile%\ recent\ * . * del / f / s / Q "% userprofile%\ Local Settings\ Temporary Internet Files\ *. *" del / f / s / Q "% temp%\ *. *" echo clears system temporary files.: del / f / s / Q% systemdrive%\ * .tmp:del / f / s / Q% systemdrive%\ *. _ mp:rd / s / Q% windir%\ temp & md% windir%\ tempecho Note: other system temporary files such as log classes should be cleaned carefully. If you don't need it, you can add other files and delete them directly under the above sentence. Echo empties trash bins, backup files and pre-cache scripts.: del / f / s / Q% systemdrive%\ recycled\ *. *: del / f / s / Q% windir%\ * .bak:del / f / s / Q% windir%\ prefetch\ *. Echo cleans up useless files under SYSTEM32\ DLLCACHE.:% windir%\ system32\ sfc.exe / purgecacheecho cleared! Echo-pause batch file creation

Create a new text document, copy and paste the above code, save the name arbitrarily (to facilitate your memory), and finally modify the format of the text document (.txt) to .bat format, you can generate a batch file, double-click to execute.

Add to shutdown script

Add to the group shutdown policy to meet the automatic call of batch files to clean up junk files when shutting down.

Shortcut key Win + R-"run"-enter gpedit.msc-enter to open the Local Group Policy Editor

"Local computer Policy"-"computer configuration"-"Windows Settings"-"script (Startup / shutdown)"-double-click "shutdown" on the right-click "add (D)."-Click "Browse (B).." in the "add script" window.-find the newly created local garbage removal bat file:

"

After adding the script, you can see the newly added script in the shutdown attribute. Click "apply"-"OK" to complete the configuration:

Of course, according to your own needs, you can also add some scripts when the system is started, logged in, logged out, etc., with similar steps. If not, you can refer to Microsoft's official documentation, which can be found in the extension.

Extended reading

Microsoft official website documentation-use startup, shutdown, login and logout scripts

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report