@ECHO OFF :: Check Windows version IF NOT "%OS%"=="Windows_NT" GOTO Syntax :: Check if XML Starlet is available XML.EXE --version >NUL 2>&1 || GOTO Syntax :: Check command line arguments ECHO.%* | FIND "?" >NUL IF NOT ERRORLEVEL 1 GOTO Syntax IF NOT "%~1"=="" IF /I NOT "%~1"=="/F" GOTO Syntax :: If /F switch is used, an existing DxDiag generated XML file will be deleted IF /I "%~1"=="/F" IF EXIST %~sdpn0.xml DEL %~sdpn0.xml :: If there is no DxDiag generated file available, create a new one (may take a minute) IF NOT EXIST %~sdpn0.xml DXDIAG.EXE /whql:off /x %~sdpn0.xml :: Loop through our selection of properties . . . FOR %%A IN (CardName DisplayMemory MonitorModel CurrentMode) DO ( SET Count=0 REM Use the -m XPATH expression to select the proper XML nodes; then REM use the -v XPATH expression to return the desired property value FOR /F "tokens=*" %%B IN ('XML.EXE sel -B -I -T -t -m "/DxDiag/DisplayDevices/DisplayDevice" -v "%%A" -n %~sdpn0.xml') DO ( CALL :GetPropertyValue %%A "%%~B" ) ) :: Display the results ECHO. ECHO %Count% instances: FOR /L %%A IN (0,1,%Count%) DO ( ECHO. SET DxVideo%%A 2>NUL ) SET Count= GOTO:EOF :GetPropertyValue :: SET DXVIDEO[video_index].[property_name]=[property_value] SET DxVideo%Count%.%1=%~2 SET /A Count += 1 GOTO:EOF :Syntax ECHO. ECHO DxVideo.bat, Version 1.01 for Windows XP ECHO List a selection of video properties for each video card and monitor ECHO. ECHO Usage: DXVIDEO [ /F ] ECHO. ECHO Where: /F forces DxDiag.exe to create a new XML file ECHO. ECHO Notes: Results are displayed and saved in environment variables DxVideoX.PPP ECHO (X is the index number of the video output, PPP is the property name). ECHO DxDiag.exe (native) is required to save DirectX data to an XML file. ECHO The creation of the XML file may take a long time, so the batch file ECHO will reuse it if available, unless the /F command line switch is used. ECHO XML Starlet is required to read the XML file. ECHO Download XML starlet from http://sourceforge.net/projects/xmlstar/ ECHO. ECHO Written by Rob van der Woude ECHO http://www.robvanderwoude.com IF "%OS%"=="Windows_NT" COLOR 00