China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-07-31 23:33
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Batch script for querying registry software information View 5,619 Replies 36
Original Poster Posted 2007-01-22 22:49 ·  美国 弗吉尼亚州 华盛顿县 Microsoft
高级用户
★★
Credits 783
Posts 268
Joined 2006-12-26 17:18
19-year member
UID 74627
Gender Male
Status Offline
Strive to post and strive for promotion ^^

Small thing used to query the software registry information installed on the computer (test environment XP)


@echo off
title Registry scanning...
mode con cols=50 lines=10
for /f "tokens=3 delims=\" %%i in ('reg query HKLM\SOFTWARE') do (
echo Current scanning information: HKLM\SOFTWARE\%%i
>>reglist.txt echo ================================================================
>>reglist.txt echo Software name:%%i
>>reglist.txt echo
================================================================
if not "%%i"=="Classes" for /f "tokens=4 delims=\" %%j in ('reg query HKLM\SOFTWARE\%%i 2^>nul') do (
echo Software information: %%j>>reglist.txt)
)
echo Scanning completed!
ping 127.0>nul
reglist.txt


Everyone's interest and support made me do some improvements again (second modification on 07/10/26):

@echo off
mode con cols=50 lines=10
setlocal enabledelayedexpansion
set PPdos=HKLM HKCU
>%temp%\reglist.txt echo %DATE%%time% Registry scanning report
for %%h in (%PPdos%) do (
title Scanning: %%h item
for /f "tokens=3 delims=\" %%i in ('reg query "%%h\SOFTWARE"') do (
echo Current scanning information: %%h\SOFTWARE\%%i
>>%temp%\reglist.txt echo ================================================================
>>%temp%\reglist.txt echo Software name:%%i
>>%temp%\reglist.txt echo ================================================================
if not "%%i"=="Classes" if not "%%i"=="Microsoft" for /f "tokens=4 delims=\" %%j in ('reg query %%h\SOFTWARE\%%i 2^>nul') do (
echo Software information: %%j>>%temp%\reglist.txt
for /f "tokens=* delims=" %%k in ('reg query "%%h\software\%%i\%%j" /S^|findstr /c:"REG_SZ" ') do (
set /a n+=1
cls
echo Scanned item value: !n! Current information: %%j
echo Associated file information:%%k>>%temp%\reglist.txt )

)
)
)

)
>>%temp%\reglist.txt echo Tip: If you need to save the result, please save the file separately BY PPdos
title FINISHED&echo Scanning completed!
ping 127.0>nul
start %temp%\reglist.txt


[ Last edited by PPdos on 2007-10-26 at 12:18 AM ]
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
ghostoyp +1 2007-03-01 07:46
菩提本无树,明镜亦非台,本来无一物,何处惹尘埃.
Floor 2 Posted 2007-01-23 07:44 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
20-year member
UID 59080
Status Offline

  Well, not bad, support!

  Tested it, some sub-keys were not detected. The owner can improve it further. It would be better if the default key value can be detected.
Floor 3 Posted 2007-01-23 09:01 ·  中国 甘肃 平凉 电信
金牌会员
★★★★
Credits 4,103
Posts 1,744
Joined 2006-01-20 13:00
20-year member
UID 49241
Gender Male
From 甘肃.临泽
Status Offline
Hehe, can be used to make portable software
Floor 4 Posted 2007-01-23 09:36 ·  美国 弗吉尼亚州 华盛顿县 Microsoft
高级用户
★★
Credits 783
Posts 268
Joined 2006-12-26 17:18
19-year member
UID 74627
Gender Male
Status Offline
```
@echo off
title Scanning Registry...
mode con cols=50 lines=10
setlocal enabledelayedexpansion
>%temp%\reglist.txt echo %DATE%%time% Registry Scan Report
for /f "tokens=3 delims=\" %%i in ('reg query HKLM\SOFTWARE') do (
echo Current scanning information: HKLM\SOFTWARE\%%i
>>%temp%\reglist.txt echo ================================================================
>>%temp%\reglist.txt echo Software Name:%%i
>>%temp%\reglist.txt echo ================================================================
if not "%%i"=="Classes" if not "%%i"=="Microsoft" for /f "tokens=4 delims=\" %%j in ('reg query HKLM\SOFTWARE\%%i 2^>nul') do (
echo Software Information: %%j>>%temp%\reglist.txt

for /f "tokens=* delims=" %%k in ('reg query "hklm\software\%%i\%%j" /S^|findstr /c:"REG_SZ" ') do (
set /a n+=1
cls
echo Number of scanned items: !n! Current information: %%j
echo Associated File Information:%%k>>%temp%\reglist.txt )

)
)
)
>>%temp%\reglist.txt echo If you need to save the result, please choose to save the file as BY PPdos
title FINISHED&echo Scan Completed!
ping 127.0>nul
start %temp%\reglist.txt
```
Recent Ratings for This Post ( 5 in total) Click for details
RaterScoreTime
ccwan +5 2007-01-24 01:46
lxmxn +6 2007-01-24 01:47
redtek +15 2007-01-24 02:17
0401 +2 2007-01-24 05:47
haiou327 +4 2008-04-22 15:24
Attachments
软件注册表信息查询.rar (666 bytes, Credits to download 1 pts, Downloads: 203)
菩提本无树,明镜亦非台,本来无一物,何处惹尘埃.
Floor 5 Posted 2007-01-23 09:51 ·  美国 弗吉尼亚州 华盛顿县 Microsoft
高级用户
★★
Credits 783
Posts 268
Joined 2006-12-26 17:18
19-year member
UID 74627
Gender Male
Status Offline
菩提本无树,明镜亦非台,本来无一物,何处惹尘埃.
Floor 6 Posted 2007-01-24 01:37 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
20-year member
UID 59080
Status Offline

  Not bad, the updated version scans more information, support!
Floor 7 Posted 2007-01-24 01:46 ·  中国 河北 廊坊 三河市 移动
金牌会员
★★★★
Credits 2,725
Posts 1,160
Joined 2006-09-23 12:00
19-year member
UID 63486
From 河北廊坊
Status Offline
Give a like, wish the thread starter to be promoted to a higher level as soon as possible
三人行,必有吾师焉。 学然后知不足,教然后知困,然后能自强也。
Floor 8 Posted 2007-01-24 02:18 ·  中国 北京 朝阳区 联通
金牌会员
★★★★
Credits 2,902
Posts 1,147
Joined 2006-09-21 12:00
19-year member
UID 63324
Gender Male
Status Offline
Appreciate + strongly support~~~
    Redtek,一个永远在网上流浪的人……

_.,-*~'`^`'~*-,.__.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._
Floor 9 Posted 2007-01-24 05:47 ·  中国 北京 朝阳区 联通
中级用户
★★
带走
Credits 435
Posts 88
Joined 2005-09-24 19:22
20-year member
UID 42793
Status Offline
Hehe, quite interesting, give support.
Floor 10 Posted 2007-01-24 06:04 ·  中国 北京 朝阳区 联通
高级用户
★★
朦胧的世界
Credits 579
Posts 218
Joined 2006-10-24 04:29
19-year member
UID 67972
Status Offline
It's pretty good, but the byte count judgment of Chinese characters by reg query output will have problems.

认识自己,降伏自己,改变自己
,才能改变别人!
Floor 11 Posted 2007-01-24 06:16 ·  中国 广东 茂名 电信
初级用户
Credits 45
Posts 23
Joined 2007-01-24 04:39
19-year member
UID 77496
Gender Male
Status Offline
Floor 12 Posted 2007-01-27 14:05 ·  中国 福建 泉州 电信
初级用户
Credits 24
Posts 13
Joined 2007-01-27 12:34
19-year member
UID 77855
Gender Male
Status Offline
Floor 13 Posted 2007-01-30 09:30 ·  中国 天津 河北区 联通
初级用户
Credits 38
Posts 16
Joined 2006-10-28 21:19
19-year member
UID 68682
Gender Male
Status Offline
Hehe, can be used to make portable software
Floor 14 Posted 2007-09-05 10:10 ·  中国 上海 浦东新区 电信
新手上路
Credits 2
Posts 1
Joined 2007-09-05 09:27
18-year member
UID 96595
Gender Male
Status Offline
Floor 15 Posted 2007-09-07 19:23 ·  中国 江苏 南京 建邺区 电信
初级用户
Credits 41
Posts 24
Joined 2007-09-04 20:16
18-year member
UID 96564
Gender Male
Status Offline
Wish the owner to be promoted to a higher level as soon as possible
Forum Jump: