|
批处理如何查看驱动版本?
下面的批处理不通用,不同的系统注册表位置不相同。
- @echo off&color 1f&echo.
- for /f "tokens=2,*" %%i in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E968-E325-11CE-BFC1-08002BE10318}\0000" /v "DriverDesc"') do set DriverDesc=%%j
- for /f "tokens=2,*" %%i in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E968-E325-11CE-BFC1-08002BE10318}\0000" /v "DriverVersion"') do set DriverVersion=%%j
- for /f "tokens=2,*" %%i in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E968-E325-11CE-BFC1-08002BE10318}\0000" /v "DriverDate"') do set DriverDate=%%j
- echo.
- echo 显卡名称: %DriverDesc%
- echo 驱动版本: %DriverVersion%
- echo 驱动日期: %DriverDate%
- for /f "tokens=2,*" %%i in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Class\{4d36e96c-e325-11ce-BFC1-08002be10318}\0000" /v "DriverDesc"') do set DriverDesc=%%j
- for /f "tokens=2,*" %%i in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E96C-E325-11CE-BFC1-08002BE10318}\0000" /v "DriverVersion"') do set DriverVersion=%%j
- for /f "tokens=2,*" %%i in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E96C-E325-11CE-BFC1-08002BE10318}\0000" /v "DriverDate"') do set DriverDate=%%j
- echo.
- echo 声卡名称: %DriverDesc%
- echo 驱动版本: %DriverVersion%
- echo 驱动日期: %DriverDate%
- for /f "tokens=2,*" %%i in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\0000" /v "DriverDesc"') do set DriverDesc=%%j
- for /f "tokens=2,*" %%i in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\0000" /v "DriverVersion"') do set DriverVersion=%%j
- for /f "tokens=2,*" %%i in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\0000" /v "DriverDate"') do set DriverDate=%%j
- echo.
- echo 网卡名称: %DriverDesc%
- echo 驱动版本: %DriverVersion%
- echo 驱动日期: %DriverDate%
- echo.&echo 按任意键退出...&pause >nul
复制代码 下面的批处理可以查看显卡驱动版本,声卡和网卡怎么写呢?
- @echo off&color 1f&echo.
- setlocal enabledelayedexpansion
- set /a Row=0
- for /f "tokens=2 delims==" %%i in ('Wmic Path Win32_VideoController Get Name^,DriverDate^,DriverVersion /value 2^>nul') do (
- set /a Row+=1
- if !Row! == 1 set Name=%%i
- if !Row! == 2 set DriverDate=%%i
- if !Row! == 3 set DriverVersion=%%i
- )
- echo 显卡名称: %DriverVersion%
- echo 驱动版本: %DriverDate%
- echo 驱动日期: %Name:~0,4%.%Name:~4,2%.%Name:~6,2%
- echo.&echo 按任意键退出...&pause >nul
复制代码
|
|