在 Windows 中通过命令行获取显卡型号

use*_*297 15 windows command-line

我需要使用从 XP 开始的所有 Windows 版本中存在的任何工具(不太可能,我还没有找到任何东西)或使用任何小的命令行第三方工具来获取带有视频卡/GPU 模型的文本输出。

有任何想法吗?

小智 25

wmic path win32_VideoController get name 
Run Code Online (Sandbox Code Playgroud)

从命令行简洁地完成工作。感谢 Vlastimil Ov?á?ík 上面的回答,但不知道为什么这么冗长。


Vla*_*čík 7

从批处理运行:

@echo off
for /F "tokens=* skip=1" %%n in ('WMIC path Win32_VideoController get Name ^| findstr "."') do set GPU_NAME=%%n
echo %GPU_NAME%
Run Code Online (Sandbox Code Playgroud)


Bra*_*ney 5

  • 复制此内容并将其另存为videoCardScript.ps1到桌面
  • 单击“开始”,然后键入powershell,然后按 Enter
  • 输入cd ~\Desktop然后按回车键
  • 输入videoCardScript.ps1然后按回车键
  • 注意:如果您收到错误提示...无法加载,因为在此系统上禁用了运行脚本。您可能需要在 powershell 中使用以下命令更改执行策略:Set-ExecutionPolicy unrestricted
  • ****确保完成后执行以下命令以维护系统的安全:**Set-ExecutionPolicy restricted

    dxdiag /x dxoutput.xml | Out-Null  #Out-Null here ensures the process here has been created before proceeding
    [xml]$xmldata = get-content "dxoutput.xml"
    $xmldata.DxDiag.DisplayDevices.DisplayDevice| % {
        $name=$_.CardName
        $manu=$_.Manufacturer
        $chip=$_.ChipType
        $type=$_.OutputType
        $version=$_.DriverVersion
        write-host "Name: `t`t`t $name"
        write-host "Manufacturer: `t`t $manu"
        write-host "Chip Type: `t`t $chip"
        write-host "Output Type: `t`t $type"
        write-host "Driver Version: `t $version"
        }
    del dxoutput.xml
    
    Run Code Online (Sandbox Code Playgroud)

如果您有兴趣获取更多信息,可以通过在命令前面del dxoutput.xml添加 来注释掉该命令。#然后,您可以查看保存到桌面的 xml 文件的内容并进行相应调整。如果您想删除脚本中的某些信息,您可以随时注释掉这些特定行或完全删除它们。

PS-您可能会看到多张相同的卡片。我在此处包含输出类型是有原因的:卡将根据它可以支持的输出数量显示多个。就我而言,我的显示器显示 DVI(不言自明)和 HD15(即 VGA)。

PSS-我在 Windows 8 机器上运行了这个。您可能需要在 XP 计算机上安装 powershell。他们需要安装 Service Pack 3,然后您可以从此处安装 Powershell:http://support.microsoft.com/kb/968929(Windows 管理框架(Windows PowerShell 2.0、WinRM 2.0 和 BITS 4.0))