比方QQ等,经常跳出对话框出来,要求更新安全模块,实则是扫描硬盘!为防止隐私泄露,就想到用批处理杀掉进程,于是:
首先我想到是这样:- @echo off
- call D:\backup\qq\Bin\QQScLauncher.exe
- taskkill /f /im TXP* >NUL 2>NUL
- taskkill /f /im tad* >NUL 2>NUL
- taskkill /f /im QQP* >NUL 2>NUL
- taskkill /f /im QQC* >NUL 2>NUL
- taskkill /f /im SogouCloud.exe >NUL 2>NUL
- pause
复制代码 发现杀掉之后,又会出来!我就想了这样:- @echo off&setlocal enabledelayedexpansion
- set T01=TXP
- set T02=tad
- set T03=QQP
- set T04=QQC
- set T05=SogouCloud.exe
- :start
- for /f %%i in ('tasklist') do (if !T01! equ %%i taskkill /f /im !T01!* >NUL 2>NUL)
- for /f %%j in ('tasklist') do (if !T02! equ %%j taskkill /f /im !T02!* >NUL 2>NUL)
- for /f %%k in ('tasklist') do (if !T03! equ %%k taskkill /f /im !T03!* >NUL 2>NUL)
- for /f %%l in ('tasklist') do (if !T04! equ %%l taskkill /f /im !T04!* >NUL 2>NUL)
- for /f %%m in ('tasklist') do (if !T05! equ %%m taskkill /f /im !T05!* >NUL 2>NUL)
- goto start
复制代码 问题在于1是特别消耗CPU,2是每次加一项屏蔽的进程,都需要重新写一边for循环,有没有好的办法,可以简化,求教各位大神! |