在WinPE 1.X时代,大部分WinPE爱好者会因为体积需求,删除了在系统属性页面显示硬件信息的功能。
当年NicTense网友便写了一个批处理,利用CPU-Z读取出硬件信息并显示在系统属性页面。
以下是批处理内容:
@echo off ::用于获取计算机型号以及CPU和主板信息,并显示在系统属性页面 ::NicTense 写于 2010.03.11 setlocal enableextensions setlocal enabledelayedexpansion x:\"Program Files"\cpuz\cpuz.exe -txt=temp for /f "tokens=1,*" %%i in (temp.txt) do ( if /i "%%i"=="Specification" set t=%%j if /i "%%i"=="DMI" if "!m!"=="" ( set m=%%j if /i "!m:~0,18!"=="System Information" (set m=y) else set m= ) if "!m!"=="y" if /i "%%i"=="manufacturer" set m=%%j if /i "%%i"=="product" set p=%%j & goto next if /i "%%i"=="Stock" set f=%%j if /i "%%i"=="Northbridge" set b=%%j ) :next if "%p%"=="" set p=Personal Computer if not "%p:To Be Filled=%"=="%p%" set p=Personal Computer if not "%p:unknown=%"=="%p%" set p=Personal Computer if "%m%"=="" set m=%p% & goto next2 if not "%m:To Be Filled=%"=="%m%" set m=%p% & goto next2 if not "%m:unknown=%"=="%m%" set m=%p% & goto next2 if not "%m:VMware=%"=="%m%" set m=%p% & goto next2 set m=%m: Inc.=% set m=%m: Corporation=% set m=%m: Company=% set m=%m: Co., Ltd.=% set m=%m: Co.,Ltd.=% set m=%m: CO., LTD=% if "%m:~-1%"==" " set m=%m:~0,-1% set m=%m% %p% :next2 if "%b%"=="" set b=Standard Video Card if not "%b:unknown=%"=="%b%" set b=Standard Video Card if "%b:~32%"=="" goto next3 set b=%b:~0,33% :loop3 set p=%b:~-1% set b=%b:~0,-1% if not "%p%"=="/" if not "%p%"==" " goto loop3 :next3 set t=%t:(TM)=% set t=%t:(R)=% set t=%t:(Engineering Sample)=% if "%t:@=%"=="%t%" if "%t:Hz=%"=="%t%" if not "%f%"=="" ( for /f "tokens=1,2,3" %%i in ("%f%") do ( set c=%%j%%k if %%j GTR 1000 if /i "%%k"=="MHz" ( set c=%%j set c=!c:~0,-3!.!c:~-3! set c=!c:~0,-1!GHz ) ) set t=%t% @ !c! ) set c= for %%k in (%t%) do if "!c!"=="" (set c=%%k) else set c=!c! %%k if not "%c:~54%"=="" set c=%c:~0,54% REG ADD HKLM\HARDWARE\DESCRIPTION\System\CentralProcessor\0 /v ProcessorNameString /t REG_SZ /d "%c%" /f if exist temp.txt del temp.txt >nul if not exist OEMINFO.INI ( echo [General]>OEMINFO.INI echo Manufacturer=%m%>>OEMINFO.INI echo Model=%b%>>OEMINFO.INI goto end ) for /f "delims== tokens=1,*" %%i in (OEMINFO.INI) do if /i "%%i"=="Manufacturer" ( echo Manufacturer=!m!>>temp.txt ) else ( if "%%i"=="Model" ( echo Model=!b!>>temp.txt ) else ( set t=%%i set t=!t: =! if "!t:~0,1!"=="[" ( echo %%i>>temp.txt ) else echo %%i=%%j>>temp.txt ) ) move /y temp.txt OEMINFO.INI >nul :end
谢谢