joken-前端工程师

  博客园 :: 首页 :: 新随笔 :: :: :: 管理 ::

window一键清理运行中的个人程序.bat 代码

@echo off
chcp 65001 >nul
title 一键清理个人程序

echo 正在清理个人程序...

powershell -NoProfile -Command "$sys = @('explorer','dwm','csrss','wininit','winlogon','svchost','fontdrvhost','ctfmon','RuntimeBroker','ApplicationFrameHost','SecurityHealthSystray','MsMpEng','taskmgr','cmd','conhost','powershell','WindowsTerminal','sihost','ShellExperienceHost','StartMenuExperienceHost','SearchHost','TextInputHost','SystemSettings','dllhost','lsass','services','smss'); Get-Process | Where-Object { $_.SessionId -eq (Get-Process -Id $PID).SessionId -and $_.Id -ne $PID -and $sys -notcontains $_.ProcessName } | Stop-Process -Force -ErrorAction SilentlyContinue"

exit

复制,然后命名:清理.bat 即可

posted on 2026-08-07 14:39  joken1310  阅读(37)  评论(0)    收藏  举报