标题: [注册表类] [分享]批处理提取系统中软件注册表 [打印本页]
作者: ptsdy 时间: 2012-11-18 14:01 标题: [分享]批处理提取系统中软件注册表
- @echo off
- echo 南无七俱胝佛母大圣准提王菩萨 !!!
- echo 南无七俱胝佛母大圣准提王菩萨 !!!
- echo 南无七俱胝佛母大圣准提王菩萨 !!!
- echo Made by ptsdy !!!
- :regstart
- set time1=%time%
- echo Please input progresse names in regedit!
- echo Example:TTPlayer TTPlayer.exe Goto Goto.exe
- set /p pro=progress names:
- if not defined pro (cls & echo No progress names!
- echo Errors! Please input again!
- goto :regstart)
- if not exist win.reg (
- echo Please export system regfile !!!
- echo press anykey and exit !
- pause >nul & exit) else (
- if not exist win.txt (
- type win.reg >win1.txt
- (findstr /i /n .* win1.txt >win1a.txt
- findstr /i /n .* win1a.txt >win.txt
- ) && del /f /q win1*.txt >nul 2>nul
- )
- )
- rem
- (type win.txt | findstr /i "%pro%" 2>nul) >soft.txt
- set /p regver=<win.txt
- set regver=%regver:~4%
- echo %regver% >soft_reg.txt
- echo.>>soft_reg.txt
- rd /s /q tmp 2>nul & md tmp 2>nul
- echo It's will take a few minutes !!!
- echo Please wait to the end !!!..........................
- setlocal enabledelayedexpansion
- for /f "tokens=1,2,* delims=:" %%h in (soft.txt) do (
- if not exist "%~dp0tmp\%%h.tmp" (
- cd.>"%~dp0tmp\%%h.tmp"
- set "a=%%h"
- set "a1=%%h"
- set "an=%%h%"
- set "b=%%j"
- set "b1=%%j"
- set "b=!b:~1,1!"
- set "bn=!b1:~2,1!"
- setlocal
- call :regup "!b!"
- endlocal
- setlocal
- call :regdown
- endlocal
- )
- )
- endlocal
- rd /s /q tmp
- echo Start Time1:%time1%
- echo End Time2:%time%
- echo .........................The end !!!
- pause
- goto eof
- :regup
- if /i "%~1" equ "H" if "!bn!" equ "K" goto eof
- set str=
- for /l %%p in (1,1,20) do (
- set /a a-=1
- set "str=!str! !a!:!a!: "
- )
- (type win.txt | findstr /i "!str!" 2>nul) >"%~dp0tmp\regtmp.txt"
- for /r "%~dp0tmp\" %%g in (regtmp.txt) do if "%%~zg" equ "0" goto eof
- :regup1
- set /a an-=1
- (type "%~dp0tmp\regtmp.txt" | findstr /i "!an!:!an!:" 2>nul) >"%~dp0tmp\regtmp1.txt"
- for /f "usebackq tokens=1,2,* delims=:" %%u in ("%~dp0tmp\regtmp1.txt") do (
- if "%%w" neq "" (
- echo.%%w >"%~dp0tmp\!an!.txt"
- if not exist "%~dp0tmp\%%u.tmp" (
- cd.>"%~dp0tmp\%%u.tmp"
- ) else goto eof
- ) else (
- for /l %%a in (!an!,1,!a1!) do (
- (type "%~dp0tmp\%%a.txt" >>soft_reg.txt) 2>nul
- )
- goto eof
- )
- )
- if "!an!" equ "!a!" goto :regup
- goto :regup1
- goto eof
- :regdown
- if "!a1!" equ "!a!" echo.!b1! >>soft_reg.txt
- set str=
- for /l %%p in (1,1,20) do (
- set /a a+=1
- set "str=!str! !a!:!a!: "
- )
- (type win.txt | findstr /i "!str!" 2>nul) >"%~dp0tmp\regtmp.txt"
- for /r "%~dp0tmp\" %%g in (regtmp.txt) do if "%%~zg" equ "0" goto eof
- :regdown1
- set /a an+=1
- (type "%~dp0tmp\regtmp.txt" | findstr /i "!an!:!an!:" 2>nul) >"%~dp0tmp\regtmp1.txt"
- for /f "usebackq tokens=1,2,* delims=:" %%m in ("%~dp0tmp\regtmp1.txt") do (
- if "%%o" neq "" (
- echo.%%o >>soft_reg.txt
- if not exist "%~dp0tmp\%%m.tmp" (
- cd.>"%~dp0tmp\%%m.tmp"
- ) else goto eof
- ) else (
- echo.>>soft_reg.txt
- goto eof
- )
- )
- if "!an!" equ "!a!" goto :regdown
- goto :regdown1
- goto eof
- :eof
复制代码
挖空心思,绞尽脑汁做了这个批处理!
做的过程中有抓狂的感觉!好不容易做出来了。感恩佛母!
执行时和导出的注册表文件放在一个目录里。
请各位网友提出指导意见!
作者: apang 时间: 2012-11-18 18:43
楼主用好多临时文件,呵呵
欢迎光临 批处理之家 (http://www.bathome.net/) |
Powered by Discuz! 7.2 |