開機(jī)啟動(dòng)項(xiàng)清理代碼bat版
更新時(shí)間:2014年05月11日 00:49:08 作者:
這篇文章主要介紹了開機(jī)啟動(dòng)項(xiàng)清理代碼,主要是通過bat實(shí)現(xiàn),代碼寫的不錯(cuò),喜歡批處理的朋友可以看下
復(fù)制代碼 代碼如下:
@echo off&setlocal enabledelayedexpansion
mode con cols=61 lines=25&color f5
mshta vbscript:msgbox("在運(yùn)行程序前,請(qǐng)確認(rèn)所有編輯資料已經(jīng)保存",,"自制優(yōu)化系統(tǒng)")(window.close)
if exist tem.txt del /f /q tem.txt
echo.正在刷選進(jìn)程.............
echo>>tem.txt explorer.exe
echo>>tem.txt System Idle Process
echo>>tem.txt System
echo>>tem.txt smss.exe
echo>>tem.txt csrss.exe
echo>>tem.txt winlogon.exe
echo>>tem.txt services.exe
echo>>tem.txt TheWorld.exe
echo>>tem.txt lsass.exe
echo>>tem.txt svchost.exe
echo>>tem.txt spoolsv.exe
echo>>tem.txt alg.exe
echo>>tem.txt ctfmon.exe
echo>>tem.txt ekrn.exe
echo>>tem.txt wdfmgr.exe
echo>>tem.txt 360tray.exe
echo>>tem.txt egui.exe
echo>>tem.txt wmiprvse.exe
echo>>tem.txt QQ.exe
echo>>tem.txt cmd.exe
echo>>tem.txt IEXPLORE.EXE
echo>>tem.txt TXPlatform.exe
echo>>tem.txt tasklist.exe
echo>>tem.txt conime.exe
echo>>tem.txt safeboxTray.exe
echo>>tem.txt Thunder5.exe
echo>>tem.txt tudouva.exe
for /f "eol= tokens=1,2 delims=," %%i in ('tasklist /nh /fo csv') do (
findstr /i /x %%i tem.txt >nul
if errorlevel 1 (
taskkill /f /pid %%j 1>nul 2>nul
)
)
del tem.txt & echo 結(jié)束進(jìn)程任務(wù)基本完成
echo ======================================
echo == ==
echo ======================================
echo 優(yōu)化開機(jī)啟動(dòng)項(xiàng)
del /f /s /q "%systemdrive%\Docume~1\All Users\「開始」菜單\程序\啟動(dòng)\*.*"
del /f /s /q "%userprofile%\「開始」菜單\程序\啟動(dòng)\*.*"
for /f "delims=\" %%j in ('fsutil fsinfo drives^|find /v ""') do (
del /f /q "%%j\*.inf">nul 2>nul &del /f /q /ah "%%j\*.exe" 2>nul
)
echo>>tem.txt "egui"
echo>>tem.txt "essact"
echo>>tem.txt "CTFMON.EXE"
set key=Software\Microsoft\Windows\CurrentVersion\run
REG EXPORT "HKCU\%key%" a.reg /nt4>nul
echo REGEDIT4 >b.reg
echo [HKEY_CURRENT_USER\%key%] >>b.reg
for /f "skip=2 eol=[ tokens=1,2 delims==" %%a in (a.reg) do (
findstr /i %%a tem.txt>nul||echo %%a=- >>b.reg
)
for /f "skip=2 delims=[" %%m in ('find /i "\run\" a.reg') do (
echo ^[^-%%m >>b.reg
)
regedit /s b.reg
REG EXPORT "HKLM\%key%" a.reg /nt4>nul
echo REGEDIT4 >b.reg
echo [HKEY_LOCAL_MACHINE\%key%] >>b.reg
for /f "skip=2 eol=[ tokens=1,2 delims==" %%a in (a.reg) do (
findstr /i %%a tem.txt>nul||echo %%a=- >>b.reg
)
for /f "skip=2 delims=[" %%m in ('find /i "\run\" a.reg') do (
echo ^[^-%%m >>b.reg
)
regedit /s b.reg
del /q a.reg
del /q b.reg
del tem.txt
echo 已經(jīng)優(yōu)化好
echo ======================================
echo == ==
echo ======================================
echo 清理部分系統(tǒng)垃圾
del /f /q %systemdrive%\*.tmp>nul 2>nul
del /f /q %systemdrive%\*._mp>nul 2>nul
del /f /q %systemdrive%\*.log>nul 2>nul
del /f /q %systemdrive%\*.gid>nul 2>nul
del /f /q %systemdrive%\*.chk>nul 2>nul
del /f /q %systemdrive%\*.old>nul 2>nul
del /f /q %windir%\*.bak>nul 2>nul
del /f /q %windir%\*.tmp>nul 2>nul
del /f /q %windir%\prefetch\*.*>nul 2>nul
del /f /s /q %systemdrive%\recycled\*.*>nul 2>nul
del /f /q "%ALLUSERSPROFILE%\Documents\DrWatson\*.*">nul 2>nul
del /f /q "%USERPROFILE%\Cookies\*.txt">nul 2>nul
del /f /q /s "%TEMP%\*.*">nul 2>nul
del /f /q /s "%Systemroot%\Prefetch\*.*">nul 2>nul
del /f /q "%USERPROFILE%\Recent\*.*">nul 2>nul
del /f /q "%USERPROFILE%\Application Data\Microsoft\Office\Recent\*.lnk">nul 2>nul
del /f /q /s "%USERPROFILE%\Local Settings\Temp\*.*">nul 2>nul
rd /s /q %windir%\temp & md %windir%\temp>nul 2>nul
if not exist %SystemRoot%\Minidump\NUL del /f /q /s %SystemRoot%\Minidump\*.*>nul 2>nul
del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*">nul 2>nul
echo 已經(jīng)清理了
mshta vbscript:msgbox("everything done!!",,"完成信息")(window.close)
taskkill /f /im cmd.exe
您可能感興趣的文章:
- Delphi創(chuàng)建開機(jī)啟動(dòng)項(xiàng)的方法示例
- android開發(fā)教程之開機(jī)啟動(dòng)服務(wù)service示例
- C#代碼設(shè)置開機(jī)啟動(dòng)示例
- c# 開機(jī)啟動(dòng)項(xiàng)的小例子
- 用批處理列出所有開機(jī)啟動(dòng)項(xiàng)的命令
- VC6.0常用快捷鍵大全
- VC實(shí)現(xiàn)讓關(guān)閉按鈕成灰色不可用的方法
- VC動(dòng)態(tài)生成菜單項(xiàng)的實(shí)現(xiàn)方法
- VC++操作SQLite簡單實(shí)例
- VC++實(shí)現(xiàn)程序開機(jī)啟動(dòng)運(yùn)行的方法
相關(guān)文章
利用批處理BAT生成隨機(jī)數(shù)實(shí)現(xiàn)隨機(jī)網(wǎng)站內(nèi)容
今天想用批處理(BAT)的方式隨機(jī)打開網(wǎng)站某頁面,基目的是刷網(wǎng)站的PV2013-05-05Windows環(huán)境bat腳本獲取文件的創(chuàng)建時(shí)間
最近都在寫ftp windows環(huán)境的一些bat腳本,為了方便顯示,想要記錄一下每次操作的時(shí)間,所以在這里總結(jié)一下windows環(huán)境bat腳本獲取時(shí)間的常用命令,感興趣的朋友一起看看吧2022-03-03Windows使用bat批處理實(shí)現(xiàn)守護(hù)進(jìn)程腳本分享
這篇文章主要介紹了Windows使用bat批處理實(shí)現(xiàn)守護(hù)進(jìn)程腳本分享,本文直接給出實(shí)現(xiàn)代碼,需要的朋友可以參考下2015-07-07regini dos下更改注冊(cè)表權(quán)限的工具
regini 可是一個(gè)好用強(qiáng)大的工具!我仔細(xì)查閱了 微軟的資料 發(fā)現(xiàn)說的含糊不清 google了下也是 寥寥幾筆 。2009-09-09實(shí)現(xiàn)百度關(guān)鍵字搜索的批處理
實(shí)現(xiàn)百度關(guān)鍵字搜索的批處理...2007-08-08