
[分享]批處理提取系統中軟件注冊表
挖空心思,絞盡腦汁做了這個批處理!做的過程中有抓狂的感覺!好不容易做出來了。感恩佛母!執行時和導出的注冊表文件放在一個目錄里。請各位網友提出指導意見!nclick="copycode($('code0'));">復制代碼
- @echo off
- echo 南無七俱胝佛母大圣準提王菩薩 !!!
- echo 南無七俱胝佛母大圣準提王菩薩 !!!
- echo 南無七俱胝佛母大圣準提王菩薩 !!!
- echo Made by ptsdy !!!
- :regstart
- set time1=%time%
- echo Pleaseinputprogressenames 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 /ftokens=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%
- echoEndTime2:%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) >%~dp0tmpregtmp.txt
- for /r %~dp0tmp %%g in (regtmp.txt) do if %%~zg equ 0 goto eof
- :regup1
- set /a an-=1
- (type %~dp0tmpregtmp.txt | findstr /i !an!:!an!: 2>nul) >%~dp0tmpregtmp1.txt
- for /fusebackq tokens=1,2,* delims=: %%u in (%~dp0tmpregtmp1.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) >%~dp0tmpregtmp.txt
- for /r %~dp0tmp %%g in (regtmp.txt) do if %%~zg equ 0 goto eof
- :regdown1
- set /a an+=1
- (type %~dp0tmpregtmp.txt | findstr /i !an!:!an!: 2>nul) >%~dp0tmpregtmp1.txt
- for /fusebackq tokens=1,2,* delims=: %%m in (%~dp0tmpregtmp1.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

