按照上面思路可以这样:- @echo off & setlocal enabledelayedexpansion
- set m=0
- set n=0
- set x=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):" "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 set Network%%i=%%d
- ) else if "!str!"=="Mode" (
- set Disk!m!Number=%%c
- set /a m+=1
- ) else if "!str!"=="Mult" (
- for /f "tokens=2 delims=@" %%i in ("%%b") do set audio!n!=%%i
- set /a n+=1
- ) else if "!str!"=="SpdO" (
- for /f "tokens=2 delims=. " %%i in ("%%a") do set Memory!x!Name=%%d
- set /a x+=1
- ) else if "!str!"=="Vide" (
- set VideoAdapter=%%b
- ) else if "!str!"=="find" (
- set monitor=%%b
- )
- )
- set CPUName
- set Memory
- set VideoAdapter
- set MotherboardInfo
- set monitor
- set Disk
- set Network
- set audio
- pause
复制代码
|