标题: [文本处理] [分享]批处理利用鲁大师日志提取硬件信息 [打印本页]
作者: yakeyun 时间: 2022-8-9 16:55 标题: [分享]批处理利用鲁大师日志提取硬件信息
已知鲁大师磁盘检测工具会触发硬件检测,然后通过批处理提取日志信息,即可得到硬件信息配置文件。那么通过其他软件来读取这个配置文件,即可做出第三方硬件检测工具UI。
如果要自己维护更新硬件数据库,可以直接从鲁大师官方下载最新版,然后把所需文件替换掉即可。
文件下载地址:https://sanli.lanzoub.com/iv7s1099mysd
代码如下:- @echo off & setlocal enabledelayedexpansion
- cd /d "%~dp0"
- if exist log\ComputerZ_HardwareDll.log (del log\ComputerZ_HardwareDll.log)
- Start /min .\Utils\DiskCheck.exe
- :top
- echo 硬件信息获取中,请稍等...
- choice /t 10 /d y /n >nul
- taskkill /f /t /IM DiskCheck.exe 1>nul 2>nul
- cls
- set top=[硬件参数]
-
- set DiskNumber=0
- set AudioNumber=0
- set MemoryNumber=0
- set Order=findstr /i /l /c:"[overviewinfowrapper] CPUName :" /c:"[processmemory] SpdOverview." /c:"[gpuprocesser] VideoAdapter" /c:"[motherboardinfowrapper] GetMotherboardInfo:" /c:"[monitorinfowrapper] find primary monitor" /c:"[disk_client] ModelNumber" /c:"[networkinfo] GetNetworkInfo: NetworkParams.strDescription" /c:"[audioinfo] Multimedia(Hi-definition Audio):" "log\ComputerZ_HardwareDll.log"
- for /f "tokens=9-12 delims=]:=" %%a in ('%Order%') do (
- set str=%%a
- set str=!str:~1,4!
- if "!str!"=="CPUN" (
- set CPUName=%%b
- ) else if "!str!"=="GetM" (
- set MotherboardInfo=%%b
- ) else if "!str!"=="GetN" (
- for /f "tokens=2 delims=[" %%i in ("%%b") do (
- if not defined _%%i set /a NetworkNumber+=1
- set Network%%i=%%d
- set _%%i=true
- )
- ) else if "!str!"=="Mode" (
- set Disk!DiskNumber!Number=%%c
- set /a DiskNumber+=1
- ) else if "!str!"=="Mult" (
- for /f "tokens=2 delims=@" %%i in ("%%b") do set Audio!AudioNumber!Number=%%i
- set /a AudioNumber+=1
- ) else if "!str!"=="SpdO" (
- for /f "tokens=2 delims=. " %%i in ("%%a") do set Memory!MemoryNumber!Name=%%d
- set /a MemoryNumber+=1
- ) else if "!str!"=="Vide" (
- set VideoAdapter=%%b
- ) else if "!str!"=="find" (
- set monitor=%%b
- )
- )
- (
- echo %top%
- set CPUName
- set MemoryNumber
- set MemoryNumber=
- set Memory
- set VideoAdapter
- set MotherboardInfo
- set monitor
- set DiskNumber
- set DiskNumber=
- set Disk
- set NetworkNumber
- set NetworkNumber=
- set Network
- set AudioNumber
- set AudioNumber=
- set Audio
- )
- PAUSE
- >sysinfo.ini
- exit
复制代码
已知问题:
如果是调用形式使用,如果自己根据对应的语言来获取鲁大师窗口,然后让其运行时隐身,硬件抓取时间在10S以内就可以获取完毕。
也可以自己根据需要来手动判断“Log\ComputerZ_HardwareDll.log”文件头尾:头尾标识-------log reset , -----log end
本来想用VBS或者SP1调用EXE使其隐身执行,但是无法实现。
欢迎光临 批处理之家 (http://bbs.bathome.net/) |
Powered by Discuz! 7.2 |