I am trying to write a script to install the correct display driver. Long story short on newer systems when you add a dedicated card the onboard is no longer disabled so when I run this command
FOR /F “tokens=2 delims==” %%i IN (‘wmic path win32_videocontroller get pnpdeviceid/value 2^>NUL ^| find /i “pnpdeviceid”‘) DO set vdcd=%%i
my vdcd variable is now set with the pnpdeviceid of the onboard, but when I add the wmic Where verb i get no result using this command
FOR /F “tokens=2 delims==” %%i IN (‘wmic path win32_videocontroller Where DeviceID=”VideoController1″ get pnpdeviceid /value 2^>NUL ^| find /i “pnpdeviceid”‘) DO set vdcd=%%i
Running just
wmic path win32_videocontroller Where DeviceID=”VideoController1” get pnpdeviceid
does result with the desired primary display adapter. I can make a mess of things and “MAKE” it work but I like to keep my scripts as clean as possible.. Making it work by writing the simple command to a txt file and then running a separate for command to read the txt document.
i did find a working work around and my script seems to be happy but im not there should be a simple solution using the orginal method just modified in some way
wmic path win32_videocontroller get deviceid, pnpdeviceid | for /f “tokens=2” %%a in (‘find /i “videocontroller1″‘) do @echo %%a >null
set /p x= < null
im just echoing the output to a file and then reading it right back in redundent and messy but works