简单版本,不知行否
将下面代码插入到1楼的代码第13行后面- @echo off
-
- for /f "tokens=1* delims==" %%a in ('wmic /namespace:\\root\wmi path WmiMonitorBasicDisplayParams where Active^="TRUE" get /value') do (
- if "%%a" == "InstanceName" set mmd= %%b
- if "%%a" == "MaxHorizontalImageSize" set wd= %%b
- if "%%a" == "MaxVerticalImageSize" set hg= %%b
- )
- for /f "tokens=2 delims=\" %%i in ("%mmd%") do set mmd=%%i
-
- set "char=`1111111111111111111111111111111 11#$%%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~"
-
- echo ============显示器信息============ >>%h%_info.txt
-
- for /f "tokens=1* delims=={" %%a in ('wmic /namespace:\\root\wmi path WmiMonitorId where Active^="TRUE" get /value') do (
- if "%%a" == "WeekOfManufacture" set wk= %%b
- if "%%a" == "YearOfManufacture" set yr= %%b
- if "%%a" == "UserFriendlyName" (
- set name= %%b_
- setlocal enabledelayedexpansion
- echo !name!|findstr "}" 1>nul && set s=0
- if defined s (
- set name=!name:}=,},!
- call :aaa "!name!"
- )
- if not defined str set "str= `"
- echo 名称 : !str:`=! >>%h%_info.txt
- endlocal
- )
- )
-
- (setlocal enabledelayedexpansion
- echo 型号 : !mmd!
- echo 屏幕尺寸 : !wd:~0,-1! X !hg:~0,-1! 厘米
- echo 生产日期 : !yr:~0,-1! 年第 !wk:~0,-1! 周
- endlocal
- )>>%h%_info.txt
- goto :bbb
-
- :aaa
- for /f "tokens=1* delims=," %%i in (%1) do (
- if "%%i" neq "}" (
- set str=!str!!char:~%%i,1!
- call :aaa "%%j"
- )
- goto :EOF
- )
-
- :bbb
复制代码
|