- 帖子
- 349
- 积分
- 508
- 技术
- 33
- 捐助
- 0
- 注册时间
- 2021-6-19
|
4楼
发表于 2021-7-21 13:15
| 只看该作者
本帖最后由 yakeyun 于 2021-7-25 19:40 编辑
回复 1# xiaolijian916
效果自测
@echo off
setlocal enabledelayedexpansion
for /f "skip=1 tokens=1-4,*" %%a in ('wmic "path" Win32_VideoController get Name^,AdapterRAM^,DriverVersion^,CurrentHorizontalResolution^,CurrentVerticalResolution') do (
If %%b == %%c (
echo,%%a %%b %%c >a1.ini
Goto p2
) else (
echo,%%a %%b %%c %%d %%e >a2.ini
goto p1
)
)
:p1
for /f "tokens=1-4,*" %%l in (a2.ini) do (
echo.
echo,显存容量:%%l
echo,系统分辨率:%%m*%%n
echo,显卡版本:%%o
echo,显卡名称:%%p
echo.
)
pause>nul
exit
:p2
for /f "tokens=1-2,*" %%h in (a1.ini) do echo,%%h %%i %%j
for /f "tokens=1-4,*" %%o in (a2.ini) do echo,%%o %%p %%q %%r %%s
echo.
echo,显存容量:%%h
echo,系统分辨率:%%o*%%p
echo,显卡版本:%%i
echo,显卡名称:%%j
echo.
pause>nul
exit
重新修改,独显核显都可以用:
@echo off
@if exist data2.ini del data2.ini
wmic "path" Win32_VideoController get name,AdapterRAM,DriverVersion,CurrentHorizontalResolution,CurrentVerticalResolution /format:csv >.\data1.ini
setlocal enabledelayedexpansion
for /f "skip=2 delims=, tokens=1,*" %%a in ('type ^"data1.ini^"') do (echo,%%b) >>.\data2.ini
@if exist data1.ini del data1.ini
::pause
for /f "delims=" %%c in ('more "data2.ini" ^| find ",,,"') do echo,%%c >.\p1.ini
for /f "delims=" %%c in ('more "data2.ini" ^| find ","') do echo,%%c >.\p2.ini
::pause
if not exist p1.ini goto 1XK
@find /I /C ",,," p1.ini > nul
@if %ERRORLEVEL% == 0 (
goto 2XK
) else (
goto 1XK
)
:1XK
echo 单显卡配置^:
for /f "delims=, tokens=1-4,*" %%h in (p2.ini) do (
set RL= %%h
if !RL! LEQ 1073741824 (set /a rl=RL/1024/1024) ELSE (set /a rl=RL/1024/1024+1)
echo.
echo,显存容量:!rl! MB
echo,系统分辨率:%%i*%%j
echo,驱动版本:%%k
echo,显卡名称:%%l
echo.
@del data2.ini
@del p2.ini
)
pause>nul
exit
:2XK
echo 双显卡配置^:
for /f "delims=, tokens=1-2,*" %%d in (p1.ini) do for /f "delims=, tokens=1-4,*" %%h in (p2.ini) do (
set RL= %%d
if !RL! LEQ 1073741824 (set /a rl=RL/1024/1024) ELSE (set /a rl=RL/1024/1024+1)
echo.
echo,显存容量:!rl! MB
echo,系统分辨率:%%i*%%j
echo,驱动版本:%%e
echo,显卡名称:%%f
echo.
@del data2.ini>nul
@del p1.ini>nul
@del p2.ini>nul
)
pause>nul
exit |
-
1
评分人数
-
|