- @echo off
- echo.关于显示器的详细信息如下:
- DxDiag /t /Whql:off dxdiag.txt
- for /f "tokens=2 delims=:" %%i in ('Findstr /IC:"Monitor Model:" Dxdiag.txt') do set "DisplayName=%%i"
- if /i "%DisplayName%"==" Unknown" for /f "tokens=2 delims=:" %%i in ('Findstr /IC:"Monitor Id:" Dxdiag.txt') do set "DisplayName=%%i"
- for /f "tokens=2" %%i in ('Wmic DesktopMonitor Get Availability^,PNPDeviceID 2^>nul') do set "PNPDeviceID=%%i"
- if "%DisplayName%"=="" for /f "delims=\ tokens=2" %%i in ("%PNPDeviceID%") do set DisplayName=%%i
- if "%DisplayName:~0,1%"==" " set DisplayName=%DisplayName:~1%
- if not "%DisplayName%"=="" set DisplayName=%DisplayName:/=-%
- echo. 型号 ........... : %DisplayName%
- for /f "tokens=2 delims=:" %%i in ('Findstr /IC:"Current Mode:" Dxdiag.txt') do if /i not "%%i"==" Unknown" set Resolution=%%i
- for /f "tokens=3" %%i in ('Reg Query "HKLM\System\CurrentControlSet\Enum\Display" /v "EDID" /s 2^>nul^|findstr /i "Edid"') do set Edid=%%i
- set /a Yeardata=0x%Edid:~34,2%+1990
- set /a Weekdata=0x%Edid:~32,2%
- set /a Longdata=0x%Edid:~42,2%
- set /a Widedata=0x%Edid:~44,2%
- echo. 生产日期 ....... : %Yeardata% 年 第 %Weekdata% 周
- set /a Diagonal=Longdata*Longdata+Weekdata*Widedata
- for /f "delims=" %%i in ('Mshta "Vbscript:CreateObject("Scripting.FileSystemObject").GetStandardStream(1).Write(sqr(%Diagonal%)/2.54)(close)"') do set Screen.In=%%i
- for /f "tokens=1,2 delims=." %%i in ("%Screen.In%") do set Screen.In=%%i&set Screen.Io=%%j
- set Screen.Io=%Screen.Io:~0,1%
- if %Screen.Io% geq 7 set /a Screen.In=%Screen.In%+1
- echo. 屏幕尺寸 ....... : %Screen.In% 英寸
- echo. 屏幕大小 ....... : %Longdata% 厘米 × %Widedata% 厘米
- for /f "skip=2 tokens=2 delims==" %%i in ('Wmic DesktopMonitor Get PixelsPerXLogicalInch /Value 2^>nul') do set PixelsPerXLogicalInch=%%i
- echo. 像素密度 ....... : %PixelsPerXLogicalInch% Dpi
- echo. 当前模式 ....... :%Resolution%
- pause
复制代码
|