Page 1 of 1

How to get GUID ID to change display setting

Posted: 31 Mar 2011 08:48
by thecoco20
Hey,

I'm trying to find the way to get GUIDs number of my display to change the setting by a batch.

So, that I tried and isn't working:
FOR /F "tokens=2 delims={}" %%a in ('REG QUERY "HKLM\SYSTEM\CurrentControlSet\Control\Video" /s /f') DO SET VIDEOCARD=%%a
ECHO Video Card GUID is: %VIDEOCARD%

Somebody can help me please

Thanks in advance

Re: How to get GUID ID to change display setting

Posted: 07 Apr 2011 09:53
by xl1000
How about this...

Code: Select all

@echo off

SET KEY=HKLM\SYSTEM\CurrentControlSet\Control\Video

REG.EXE QUERY %KEY%> video_reg.txt

FOR /F "tokens=1,2,3,4,5,6 delims=\" %%i IN ( video_reg.txt ) DO (
   REM ECHO %%m - %%n
   IF "%%n" NEQ "" ECHO Video Card GUID present: %%n
)


or without the {} chars included

Code: Select all

@echo off

SET KEY=HKLM\SYSTEM\CurrentControlSet\Control\Video

REG.EXE QUERY %KEY%> video_reg.txt

FOR /F "tokens=1,2,* delims={}" %%i IN ( video_reg.txt ) DO (
   REM ECHO %%i - %%j - %%k
   IF "%%j" NEQ "" ECHO Video Card GUID present: %%j
)