本帖最后由 hanyeguxing 于 2011-4-14 04:47 编辑
xp sp3 下以递归 HKLM\SOFTWARE\Classes\ 中所有包含 ShellNew 子项的项为例:- @echo off&setlocal enabledelayedexpansion
- set "n=reg query HKLM\SOFTWARE\Classes"
- for /f "skip=4 tokens=2 delims=R>" %%a in ('%n%\.bat /ve') do set "m=%%a"
- for /f "skip=6 delims=" %%a in ('%n%') do (
- set "a=%%a"
- if not "!a:~36,1!"=="." goto:e
- %n%\!a:~36!\ShellNew >nul 2>nul&&for /f "skip=4 tokens=3 delims=%m%" %%b in ('%n%\!a:~36! /ve') do for /f "skip=4 tokens=3 delims=%m%" %%c in ('%n%\%%b /ve 2^>nul') do echo;!a:~36! %%c
- )
- :e
- echo;完成&pause
复制代码
|