标题: [注册表类] [分享]批处理查找注册表满足三个条件的子项 [打印本页]
作者: Batcher 时间: 2023-6-10 19:49 标题: [分享]批处理查找注册表满足三个条件的子项
【问题描述】
通过CMD文件判断 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\的子项中满足这3个条件:
DependOnService是“FltMgr”
Group是“FSFilter Activity Monitor”
ImagePath是“\??\”开头的
作者: Batcher 时间: 2023-6-10 19:50
【解决方案】
test-1.bat- @echo off
- cd /d "%~dp0"
- set "OutFile=1.log"
- type nul >"%OutFile%"
- for /f "delims=" %%i in ('reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services"') do (
- for /f "delims=" %%j in ('reg query "%%i" ^| findstr /c:"DependOnService REG_MULTI_SZ FltMgr" /c:"Group REG_SZ FSFilter Activity Monitor" /c:"ImagePath REG_EXPAND_SZ \\??\\" ^| find /v /c ""') do (
- echo [%%j] %%i
- if %%j equ 3 (
- >>"%OutFile%" echo,%%i
- )
- )
- )
- echo --------------------------------------------------
- type "%OutFile%"
- pause
复制代码
欢迎光临 批处理之家 (http://bbs.bathome.net/) |
Powered by Discuz! 7.2 |