開機(jī)啟動(dòng)項(xiàng)清理代碼bat版
來源:易賢網(wǎng) 閱讀:834 次 日期:2016-06-15 09:28:13
溫馨提示:易賢網(wǎng)小編為您整理了“開機(jī)啟動(dòng)項(xiàng)清理代碼bat版”,方便廣大網(wǎng)友查閱!

這篇文章主要介紹了開機(jī)啟動(dòng)項(xiàng)清理代碼,主要是通過bat實(shí)現(xiàn),代碼寫的不錯(cuò),喜歡批處理的朋友可以看下

代碼如下:

@echo off&setlocal enabledelayedexpansion

mode con cols=61 lines=25&color f5

mshta vbscript:msgbox(在運(yùn)行程序前,請確認(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

更多信息請查看腳本欄目
易賢網(wǎng)手機(jī)網(wǎng)站地址:開機(jī)啟動(dòng)項(xiàng)清理代碼bat版
由于各方面情況的不斷調(diào)整與變化,易賢網(wǎng)提供的所有考試信息和咨詢回復(fù)僅供參考,敬請考生以權(quán)威部門公布的正式信息和咨詢?yōu)闇?zhǔn)!

2025國考·省考課程試聽報(bào)名

  • 報(bào)班類型
  • 姓名
  • 手機(jī)號
  • 驗(yàn)證碼
關(guān)于我們 | 聯(lián)系我們 | 人才招聘 | 網(wǎng)站聲明 | 網(wǎng)站幫助 | 非正式的簡要咨詢 | 簡要咨詢須知 | 加入群交流 | 手機(jī)站點(diǎn) | 投訴建議
工業(yè)和信息化部備案號:滇ICP備2023014141號-1 云南省教育廳備案號:云教ICP備0901021 滇公網(wǎng)安備53010202001879號 人力資源服務(wù)許可證:(云)人服證字(2023)第0102001523號
云南網(wǎng)警備案專用圖標(biāo)
聯(lián)系電話:0871-65099533/13759567129 獲取招聘考試信息及咨詢關(guān)注公眾號:hfpxwx
咨詢QQ:526150442(9:00—18:00)版權(quán)所有:易賢網(wǎng)
云南網(wǎng)警報(bào)警專用圖標(biāo)