Solved query monitor EDID


ClassGUID is the same value as Driver, but without the trailing \number.
Code:
foreach ($HWID in @(Get-CimInstance win32_VideoController | Where-Object {$_.AdapterDACType -notlike "Internal"} | Select-Object -ExpandProperty PNPDeviceID)) {
    $ClassGUID = Get-ItemPropertyValue -Path "HKLM:SYSTEM\ControlSet001\Enum\$HWID" -Name ClassGUID

    $ClassGUID
    $Display = 'something'

    New-Item -Path "HKLM:SYSTEM\ControlSet001\Control\Class\$HWID\DAL3_DATA\common\$Display" -Force -WhatIf
    New-ItemProperty -Path "HKLM:SYSTEM\ControlSet001\Control\Class\$HWID\DAL3_DATA\common\$Display" -Name "color_depth" -Value ([byte[]]@(0x04,0x00,0x00,0x00)) -PropertyType Binary -Force -WhatIf
}

When in doubt, pipe the output of some call through Format-List. This dumps all the values in the returned data object.
Code:
Get-CimInstance win32_VideoController | Where-Object {$_.AdapterDACType -notlike "Internal"} | fl
 

My Computer My Computer

At a glance

Windows 7
OS
Windows 7
i made some discoveries. the "Control\Video\foo-foo-foo-foo-foo" key changes everytime a "Refresh your PC" is done. So this GUID is not generated by card type, its just random.

whats even more odd is when trying to write to the "Control\Class\$ClassGUID" keys for color_depth with set-itemproperty or new-itemproperty, it says it doesnt exist.

when trying to do a new-item entry, it wont apply the DisplayPath part, even if i specifically add 12 to the end of the EDID line. is there something wrong with the code?

Code:
function Convert-BigEndianToLittleEndian {
    param(
        [int]$BigEndianValue
    )

    $bytes = [System.BitConverter]::GetBytes($BigEndianValue)
    [Array]::Reverse($bytes)
    return [System.BitConverter]::ToUInt32($bytes,0)
}

foreach ($Monitor in @(Get-WmiObject -Namespace root\wmi -Class WmiMonitorID)) {
    $bigEndianInt32 = [Convert]::ToInt32(-join $Monitor.ManufacturerName[0..2].ForEach({[Convert]::ToString($_ - 64,2).PadLeft(5,'0')}),2)
    $Manufacturer = (Convert-BigEndianToLittleEndian $bigEndianInt32) -shr 16

    $ProductID = [int]::Parse(-join $Monitor.ProductCodeID[0..3].ForEach{[char]$_}, [System.Globalization.NumberStyles]::HexNumber)

    $Model = ([System.Text.Encoding]::ASCII.GetString($Monitor.UserFriendlyName[0..($Monitor.UserFriendlyNameLength -3)]) -split ' ')[0]

    'EDID_{0}_{1}_{2}_12' -f $Manufacturer, $ProductID, $Model #DisplayPath

    $Display0 = 'EDID_{0}_{1}_{2}_0' -f $Manufacturer, $ProductID, $Model #DisplayPath
    $Display1 = 'EDID_{0}_{1}_{2}_1' -f $Manufacturer, $ProductID, $Model #DisplayPath
    $Display2 = 'EDID_{0}_{1}_{2}_2' -f $Manufacturer, $ProductID, $Model #DisplayPath
    $Display3 = 'EDID_{0}_{1}_{2}_3' -f $Manufacturer, $ProductID, $Model #DisplayPath
    $Display4 = 'EDID_{0}_{1}_{2}_4' -f $Manufacturer, $ProductID, $Model #DisplayPath
    $Display5 = 'EDID_{0}_{1}_{2}_5' -f $Manufacturer, $ProductID, $Model #DisplayPath
    $Display6 = 'EDID_{0}_{1}_{2}_6' -f $Manufacturer, $ProductID, $Model #DisplayPath
    $Display7 = 'EDID_{0}_{1}_{2}_7' -f $Manufacturer, $ProductID, $Model #DisplayPath
    $Display8 = 'EDID_{0}_{1}_{2}_8' -f $Manufacturer, $ProductID, $Model #DisplayPath
    $Display9 = 'EDID_{0}_{1}_{2}_9' -f $Manufacturer, $ProductID, $Model #DisplayPath
    $Display10 = 'EDID_{0}_{1}_{2}_10' -f $Manufacturer, $ProductID, $Model #DisplayPath
    $Display11 = 'EDID_{0}_{1}_{2}_11' -f $Manufacturer, $ProductID, $Model #DisplayPath
    $Display12 = 'EDID_{0}_{1}_{2}_12' -f $Manufacturer, $ProductID, $Model #DisplayPath
    $Display13 = 'EDID_{0}_{1}_{2}_13' -f $Manufacturer, $ProductID, $Model #DisplayPath
}

foreach ($HWID in @(Get-CimInstance win32_VideoController | Where-Object {$_.AdapterDACType -notlike "Internal"} | Select-Object -ExpandProperty PNPDeviceID)) {
    $ClassGUID = Get-ItemPropertyValue -Path "HKLM:SYSTEM\ControlSet001\Enum\$HWID" -Name ClassGUID

    $ClassGUID

    #New-Item -Path "HKLM:SYSTEM\ControlSet001\Control\Class\$ClassGUID\0000\DAL3_DATA\common\$Display12" -Force
    #New-ItemProperty -Path "HKLM:SYSTEM\ControlSet001\Control\Class\$ClassGUID\0000\DAL3_DATA\common\$Display12" -Name "color_depth" -Value ([byte[]]@(0x02,0x00,0x00,0x00)) -PropertyType Binary -Force
    Set-ItemProperty -Path "HKLM:SYSTEM\ControlSet001\Control\Class\$ClassGUID\0000\DAL3_DATA\common\$Display12" -Name "color_depth" -Value ([byte[]]@(0x02,0x00,0x00,0x00)) -Force
  
    #New-Item -Path "HKLM:SYSTEM\ControlSet001\Control\Class\$ClassGUID\0001\DAL3_DATA\common\$Display12" -Force
    #New-ItemProperty -Path "HKLM:SYSTEM\ControlSet001\Control\Class\$ClassGUID\0001\DAL3_DATA\common\$Display12" -Name "color_depth" -Value ([byte[]]@(0x02,0x00,0x00,0x00)) -PropertyType Binary -Force
    Set-ItemProperty -Path "HKLM:SYSTEM\ControlSet001\Control\Class\$ClassGUID\0001\DAL3_DATA\common\$Display12" -Name "color_depth" -Value ([byte[]]@(0x02,0x00,0x00,0x00)) -Force

    #New-Item -Path "HKLM:SYSTEM\CurrentControlSet\Control\Class\$ClassGUID\0000\DAL3_DATA\common\$Display12" -Force
    #New-ItemProperty -Path "HKLM:SYSTEM\CurrentControlSet\Control\Class\$ClassGUID\0000\DAL3_DATA\common\$Display12" -Name "color_depth" -Value ([byte[]]@(0x02,0x00,0x00,0x00)) -PropertyType Binary -Force
    Set-ItemProperty -Path "HKLM:SYSTEM\CurrentControlSet\Control\Class\$ClassGUID\0000\DAL3_DATA\common\$Display12" -Name "color_depth" -Value ([byte[]]@(0x02,0x00,0x00,0x00)) -Force
  
    #New-Item -Path "HKLM:SYSTEM\CurrentControlSet\Control\Class\$ClassGUID\0001\DAL3_DATA\common\$Display12" -Force
    #New-ItemProperty -Path "HKLM:SYSTEM\CurrentControlSet\Control\Class\$ClassGUID\0001\DAL3_DATA\common\$Display12" -Name "color_depth" -Value ([byte[]]@(0x02,0x00,0x00,0x00)) -PropertyType Binary -Force
    Set-ItemProperty -Path "HKLM:SYSTEM\CurrentControlSet\Control\Class\$ClassGUID\0001\DAL3_DATA\common\$Display12" -Name "color_depth" -Value ([byte[]]@(0x02,0x00,0x00,0x00)) -Force

}

cmd /k 'pause'
 

My Computer My Computer

At a glance

Windows 11 27965Intel i7 7700 @4.0ghz64gb DDR4Radeon RX 5500 XT
OS
Windows 11 27965
Computer type
PC/Desktop
CPU
Intel i7 7700 @4.0ghz
Memory
64gb DDR4
Graphics Card(s)
Radeon RX 5500 XT
Sound Card
Topping D50s
Hard Drives
NVMe
PSU
Corsair
Keyboard
Stelseries G6v2
Mouse
Zowie EC2
Other Info
https://www.youtube.com/shoober420
New-ItemProperty allows you to use "-PropertyType Binary", which is useful because Set-ItemProperty I believe only automatically recognizes strings vs. numbers. So you can't use Set-ItemProperty to force a data type that isn't a string or a number.
 

My Computer My Computer

At a glance

Windows 7
OS
Windows 7
i found the foo string, its called VideoID. i still get an error about the key not existing in both "Control\Class" and "Control\Video". is this registry key protected and need ownership?

when using new-item, it always shaves off the DisplayPath number, its like the key with the DisplayPath number thats present by default is protected

Code:
function Convert-BigEndianToLittleEndian {
    param(
        [int]$BigEndianValue
    )

    $bytes = [System.BitConverter]::GetBytes($BigEndianValue)
    [Array]::Reverse($bytes)
    return [System.BitConverter]::ToUInt32($bytes,0)
}

foreach ($Monitor in @(Get-WmiObject -Namespace root\wmi -Class WmiMonitorID)) {
    $bigEndianInt32 = [Convert]::ToInt32(-join $Monitor.ManufacturerName[0..2].ForEach({[Convert]::ToString($_ - 64,2).PadLeft(5,'0')}),2)
    $Manufacturer = (Convert-BigEndianToLittleEndian $bigEndianInt32) -shr 16

    $ProductID = [int]::Parse(-join $Monitor.ProductCodeID[0..3].ForEach{[char]$_}, [System.Globalization.NumberStyles]::HexNumber)

    $Model = ([System.Text.Encoding]::ASCII.GetString($Monitor.UserFriendlyName[0..($Monitor.UserFriendlyNameLength -3)]) -split ' ')[0]

    'EDID_{0}_{1}_{2}_12' -f $Manufacturer, $ProductID, $Model #DisplayPath

    $Display0 = 'EDID_{0}_{1}_{2}_0' -f $Manufacturer, $ProductID, $Model #DisplayPath
    $Display1 = 'EDID_{0}_{1}_{2}_1' -f $Manufacturer, $ProductID, $Model #DisplayPath
    $Display2 = 'EDID_{0}_{1}_{2}_2' -f $Manufacturer, $ProductID, $Model #DisplayPath
    $Display3 = 'EDID_{0}_{1}_{2}_3' -f $Manufacturer, $ProductID, $Model #DisplayPath
    $Display4 = 'EDID_{0}_{1}_{2}_4' -f $Manufacturer, $ProductID, $Model #DisplayPath
    $Display5 = 'EDID_{0}_{1}_{2}_5' -f $Manufacturer, $ProductID, $Model #DisplayPath
    $Display6 = 'EDID_{0}_{1}_{2}_6' -f $Manufacturer, $ProductID, $Model #DisplayPath
    $Display7 = 'EDID_{0}_{1}_{2}_7' -f $Manufacturer, $ProductID, $Model #DisplayPath
    $Display8 = 'EDID_{0}_{1}_{2}_8' -f $Manufacturer, $ProductID, $Model #DisplayPath
    $Display9 = 'EDID_{0}_{1}_{2}_9' -f $Manufacturer, $ProductID, $Model #DisplayPath
    $Display10 = 'EDID_{0}_{1}_{2}_10' -f $Manufacturer, $ProductID, $Model #DisplayPath
    $Display11 = 'EDID_{0}_{1}_{2}_11' -f $Manufacturer, $ProductID, $Model #DisplayPath
    $Display12 = 'EDID_{0}_{1}_{2}_12' -f $Manufacturer, $ProductID, $Model #DisplayPath
    $Display13 = 'EDID_{0}_{1}_{2}_13' -f $Manufacturer, $ProductID, $Model #DisplayPath
}

foreach ($HWID in @(Get-CimInstance win32_VideoController | Where-Object {$_.AdapterDACType -notlike "Internal"} | Select-Object -ExpandProperty PNPDeviceID)) {
    $ClassGUID = Get-ItemPropertyValue -Path "HKLM:SYSTEM\ControlSet001\Enum\$HWID" -Name ClassGUID
    $ClassGUID2 = Get-ItemPropertyValue -Path "HKLM:SYSTEM\ControlSet001\Enum\$HWID" -Name Driver
    $VideoID = Get-ItemPropertyValue -Path "HKLM:SYSTEM\ControlSet001\Enum\$HWID\Device Parameters" -Name VideoID

    $ClassGUID
    $ClassGUID2
    $VideoID

    #New-Item -Path "HKLM:SYSTEM\ControlSet001\Control\Class\$ClassGUID2\DAL3_DATA\common\$Display12" -Force
    New-ItemProperty -Path "HKLM:SYSTEM\ControlSet001\Control\Class\$ClassGUID2\DAL3_DATA\common\$Display12" -Name "color_depth" -Value ([byte[]]@(0x02,0x00,0x00,0x00)) -PropertyType Binary -Force
    #Set-ItemProperty -Path "HKLM:SYSTEM\ControlSet001\Control\Class\$ClassGUID2\DAL3_DATA\common\$Display12" -Name "color_depth" -Value ([byte[]]@(0x02,0x00,0x00,0x00)) -Force
 
    #New-Item -Path "HKLM:SYSTEM\CurrentControlSet\Control\Class\$ClassGUID2\DAL3_DATA\common\$Display12" -Force
    New-ItemProperty -Path "HKLM:SYSTEM\CurrentControlSet\Control\Class\$ClassGUID2\DAL3_DATA\common\$Display12" -Name "color_depth" -Value ([byte[]]@(0x02,0x00,0x00,0x00)) -PropertyType Binary -Force
    #Set-ItemProperty -Path "HKLM:SYSTEM\CurrentControlSet\Control\Class\$ClassGUID2\DAL3_DATA\common\$Display12" -Name "color_depth" -Value ([byte[]]@(0x02,0x00,0x00,0x00)) -Force



    #New-Item -Path "HKLM:SYSTEM\ControlSet001\Control\Video\$VideoID\0000\DAL3_DATA\common\$Display12" -Force
    New-ItemProperty -Path "HKLM:SYSTEM\ControlSet001\Control\Video\$VideoID\0000\DAL3_DATA\common\$Display12" -Name "color_depth" -Value ([byte[]]@(0x02,0x00,0x00,0x00)) -PropertyType Binary -Force
    #Set-ItemProperty -Path "HKLM:SYSTEM\ControlSet001\Control\Video\$VideoID\0000\DAL3_DATA\common\$Display12" -Name "color_depth" -Value ([byte[]]@(0x02,0x00,0x00,0x00)) -Force
 
    #New-Item -Path "HKLM:SYSTEM\CurrentControlSet\Control\Video\$VideoID\0000\DAL3_DATA\common\$Display12" -Force
    New-ItemProperty -Path "HKLM:SYSTEM\CurrentControlSet\Control\Video\$VideoID\0000\DAL3_DATA\common\$Display12" -Name "color_depth" -Value ([byte[]]@(0x02,0x00,0x00,0x00)) -PropertyType Binary -Force
    #Set-ItemProperty -Path "HKLM:SYSTEM\CurrentControlSet\Control\Video\$VideoID\0000\DAL3_DATA\common\$Display12" -Name "color_depth" -Value ([byte[]]@(0x02,0x00,0x00,0x00)) -Force

}

cmd /k 'pause'
 
Last edited:

My Computer My Computer

At a glance

Windows 11 27965Intel i7 7700 @4.0ghz64gb DDR4Radeon RX 5500 XT
OS
Windows 11 27965
Computer type
PC/Desktop
CPU
Intel i7 7700 @4.0ghz
Memory
64gb DDR4
Graphics Card(s)
Radeon RX 5500 XT
Sound Card
Topping D50s
Hard Drives
NVMe
PSU
Corsair
Keyboard
Stelseries G6v2
Mouse
Zowie EC2
Other Info
https://www.youtube.com/shoober420
Some kernel or driver-related keys have protected permissions, and you need to be TrustedInstaller to update them.

I'd run the script under PowerRun.
 

My Computer My Computer

At a glance

Windows 7
OS
Windows 7
i just manually added in the monitor EDID and replaced $Display, and it worked. using $VideoID is fine. why would using the $Display code not apply it correctly?


heres the error output
Code:
New-ItemProperty : Cannot find path 'HKLM:\SYSTEM\ControlSet001\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\00
01\DAL3_DATA\common\EDID_14937_4166_D32h-J09_12' because it does not exist.
At C:\Users\cr4ss\Downloads\wtfplease.ps1:50 char:5
+     New-ItemProperty -Path "HKLM:SYSTEM\ControlSet001\Control\Class\$ ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (HKLM:\SYSTEM\Co..._D32h-J09_12:String) [New-ItemProperty], ItemNotFo
   undException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.NewItemPropertyCommand

New-ItemProperty : Cannot find path 'HKLM:\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318
}\0001\DAL3_DATA\common\EDID_14937_4166_D32h-J09_12' because it does not exist.
At C:\Users\cr4ss\Downloads\wtfplease.ps1:54 char:5
+     New-ItemProperty -Path "HKLM:SYSTEM\CurrentControlSet\Control\Cla ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (HKLM:\SYSTEM\Cu..._D32h-J09_12:String) [New-ItemProperty], ItemNotFo
   undException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.NewItemPropertyCommand

New-ItemProperty : Cannot find path 'HKLM:\SYSTEM\ControlSet001\Control\Video\{17868428-ED43-11EF-9669-E964B247E111}\00
00\DAL3_DATA\common\EDID_14937_4166_D32h-J09_12' because it does not exist.
At C:\Users\cr4ss\Downloads\wtfplease.ps1:60 char:5
+     New-ItemProperty -Path "HKLM:SYSTEM\ControlSet001\Control\Video\$ ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (HKLM:\SYSTEM\Co..._D32h-J09_12:String) [New-ItemProperty], ItemNotFo
   undException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.NewItemPropertyCommand

New-ItemProperty : Cannot find path 'HKLM:\SYSTEM\CurrentControlSet\Control\Video\{17868428-ED43-11EF-9669-E964B247E111
}\0000\DAL3_DATA\common\EDID_14937_4166_D32h-J09_12' because it does not exist.
At C:\Users\cr4ss\Downloads\wtfplease.ps1:64 char:5
+     New-ItemProperty -Path "HKLM:SYSTEM\CurrentControlSet\Control\Vid ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (HKLM:\SYSTEM\Cu..._D32h-J09_12:String) [New-ItemProperty], ItemNotFo
   undException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.NewItemPropertyCommand
 

My Computer My Computer

At a glance

Windows 11 27965Intel i7 7700 @4.0ghz64gb DDR4Radeon RX 5500 XT
OS
Windows 11 27965
Computer type
PC/Desktop
CPU
Intel i7 7700 @4.0ghz
Memory
64gb DDR4
Graphics Card(s)
Radeon RX 5500 XT
Sound Card
Topping D50s
Hard Drives
NVMe
PSU
Corsair
Keyboard
Stelseries G6v2
Mouse
Zowie EC2
Other Info
https://www.youtube.com/shoober420
i made some progress figuring out the last DisplayPath option. i was looking for a unique key that seperates the other DisplayPath choices and found one.

BestViewOption_Hdmi

the other DisplayPath trees only have "BestViewOption" without the Hdmi. i posted on guru3d to see if someone can tell me what the option says when using a DisplayPort connection. im guessing "BestViewOption_Dp", but i want to make sure

discovering this, i tried writing a string that can pull "BestViewOption_Hdmi" recursively from the main tree to find which DisplayPath is active. here is my attempt code, it unfortunately doesnt work

Code:
Get-ChildItem -Path "HKLM:SYSTEM\ControlSet001\Control\Video\{17868428-ED43-11EF-9669-E964B247E111}\0001\DAL2_DATA__2_0\DisplayPath_*" -Recurse | Select-Object BestViewOption_Hdmi

i dont know how to tell powershell to use the reg path it found BestViewOption_Hdmi in and print the reg directory. is this possible?
 

My Computer My Computer

At a glance

Windows 11 27965Intel i7 7700 @4.0ghz64gb DDR4Radeon RX 5500 XT
OS
Windows 11 27965
Computer type
PC/Desktop
CPU
Intel i7 7700 @4.0ghz
Memory
64gb DDR4
Graphics Card(s)
Radeon RX 5500 XT
Sound Card
Topping D50s
Hard Drives
NVMe
PSU
Corsair
Keyboard
Stelseries G6v2
Mouse
Zowie EC2
Other Info
https://www.youtube.com/shoober420
Search for a key name in a reg tree path:
Code:
Get-ChildItem 'HKLM:SYSTEM\ControlSet001\Control\Video\{17868428-ED43-11EF-9669-E964B247E111}\0001\DAL2_DATA__2_0' -Recurse |% { if ((Split-Path -Leaf $_) -eq 'BestViewOption_Hdmi') { $_.Name } }
 

My Computer My Computer

At a glance

Windows 7
OS
Windows 7
the string above doesnt print the reg key directory for "BestViewOption_Hdmi". the whole reg key path that setting is found in is:

Code:
HKLM\SYSTEM\CurrentControlSet\Control\Video\{17868428-ED43-11EF-9669-E964B247E111}\0001\DAL2_DATA__2_0\DisplayPath_12\Option

using -Recurse will check all reg directories after "DAL_DATA__2_0" right (DisplayPath_* and Option)? or does it only check keys in "DAL_DATA__2_0"?

if i pipe "Select-Object "BestViewOption_Hdmi" to the string it still outputs blank
 

My Computer My Computer

At a glance

Windows 11 27965Intel i7 7700 @4.0ghz64gb DDR4Radeon RX 5500 XT
OS
Windows 11 27965
Computer type
PC/Desktop
CPU
Intel i7 7700 @4.0ghz
Memory
64gb DDR4
Graphics Card(s)
Radeon RX 5500 XT
Sound Card
Topping D50s
Hard Drives
NVMe
PSU
Corsair
Keyboard
Stelseries G6v2
Mouse
Zowie EC2
Other Info
https://www.youtube.com/shoober420
Key or value? I can't understand what you're seeing.

Go into regedit, select "HKLM\SYSTEM\CurrentControlSet\Control\Video\{17868428-ED43-11EF-9669-E964B247E111}\", export that to a reg file. Post it here.
 

My Computer My Computer

At a glance

Windows 7
OS
Windows 7

My Computer My Computer

At a glance

Windows 11 27965Intel i7 7700 @4.0ghz64gb DDR4Radeon RX 5500 XT
OS
Windows 11 27965
Computer type
PC/Desktop
CPU
Intel i7 7700 @4.0ghz
Memory
64gb DDR4
Graphics Card(s)
Radeon RX 5500 XT
Sound Card
Topping D50s
Hard Drives
NVMe
PSU
Corsair
Keyboard
Stelseries G6v2
Mouse
Zowie EC2
Other Info
https://www.youtube.com/shoober420
Code:
$SearchPath = 'HKLM:\SYSTEM\ControlSet001\Control\Video\{17868428-ED43-11EF-9669-E964B247E111}'

foreach ($Path in @(Get-ChildItem $SearchPath -Recurse |% { Get-ItemProperty $_.PSPATH -Name *BestViewOption_Hdmi* | select PSPath } | Sort-Object -Unique | Convert-Path)) {
    $Path
}
Code:
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Video\{17868428-ED43-11EF-9669-E964B247E111}\0000\DAL2_DATA__2_0\DisplayPath_12\Option
 

My Computer My Computer

At a glance

Windows 7
OS
Windows 7
dude awesome, i added some code to trim the displaypath reg key so that it just outputs the number. i then added $DisplayPathNumber.Matches.Value in the {3} sequence.

Code:
function Convert-BigEndianToLittleEndian {
    param(
        [int]$BigEndianValue
    )

    $bytes = [System.BitConverter]::GetBytes($BigEndianValue)
    [Array]::Reverse($bytes)
    return [System.BitConverter]::ToUInt32($bytes,0)
}

foreach ($HWID in @(Get-CimInstance win32_VideoController | Where-Object {$_.AdapterDACType -notlike "Internal"} | Select-Object -ExpandProperty PNPDeviceID)) {
    $ClassGUID = Get-ItemPropertyValue -Path "HKLM:SYSTEM\ControlSet001\Enum\$HWID" -Name ClassGUID
    $ClassGUID2 = Get-ItemPropertyValue -Path "HKLM:SYSTEM\ControlSet001\Enum\$HWID" -Name Driver
    $VideoID = Get-ItemPropertyValue -Path "HKLM:SYSTEM\ControlSet001\Enum\$HWID\Device Parameters" -Name VideoID

    $ClassGUID
    $ClassGUID2
    $VideoID

}

$SearchPath = "HKLM:\SYSTEM\ControlSet001\Control\Video\$VideoID"

foreach ($Path in @(Get-ChildItem $SearchPath -Recurse |% { Get-ItemProperty $_.PSPATH -Name *BestViewOption_Hdmi* | select PSPath } | Sort-Object -Unique | Convert-Path)) {
    $Path

$DisplayPathNumber = Select-String -InputObject $Path -Pattern "(?<=DisplayPath_).*?(?=\\Option)"

$DisplayPathNumber.Matches.Value

}

foreach ($Monitor in @(Get-WmiObject -Namespace root\wmi -Class WmiMonitorID)) {
    $bigEndianInt32 = [Convert]::ToInt32(-join $Monitor.ManufacturerName[0..2].ForEach({[Convert]::ToString($_ - 64,2).PadLeft(5,'0')}),2)
    $Manufacturer = (Convert-BigEndianToLittleEndian $bigEndianInt32) -shr 16

    $ProductID = [int]::Parse(-join $Monitor.ProductCodeID[0..3].ForEach{[char]$_}, [System.Globalization.NumberStyles]::HexNumber)

    $Model = ([System.Text.Encoding]::ASCII.GetString($Monitor.UserFriendlyName[0..($Monitor.UserFriendlyNameLength -3)]) -split ' ')[0]

    'EDID_{0}_{1}_{2}_{3}' -f $Manufacturer, $ProductID, $Model, $DisplayPathNumber.Matches.Value

    $DisplayPath = 'EDID_{0}_{1}_{2}_{3}' -f $Manufacturer, $ProductID, $Model, $DisplayPathNumber.Matches.Value

}

    #New-Item -Path "HKLM:SYSTEM\ControlSet001\Control\Class\$ClassGUID2\DAL3_DATA\common\$DisplayPath" -Force
    New-ItemProperty -Path "HKLM:SYSTEM\ControlSet001\Control\Class\$ClassGUID2\DAL3_DATA\common\$DisplayPath" -Name color_depth -Value ([byte[]]@(0x04,0x00,0x00,0x00)) -PropertyType Binary -Force
    #Set-ItemProperty -Path "HKLM:SYSTEM\ControlSet001\Control\Class\$ClassGUID2\DAL3_DATA\common\$DisplayPath" -Name color_depth -Value ([byte[]]@(0x02,0x00,0x00,0x00)) -Force
 
    #New-Item -Path 'HKLM:SYSTEM\CurrentControlSet\Control\Class\$ClassGUID2\DAL3_DATA\common\$DisplayPath" -Force                         
    New-ItemProperty -Path "HKLM:SYSTEM\CurrentControlSet\Control\Class\$ClassGUID2\DAL3_DATA\common\$DisplayPath" -Name color_depth -Value ([byte[]]@(0x04,0x00,0x00,0x00)) -PropertyType Binary -Force
    #Set-ItemProperty -Path "HKLM:SYSTEM\CurrentControlSet\Control\Class\$ClassGUID2\DAL3_DATA\common\$DisplayPath" -Name color_depth -Value ([byte[]]@(0x02,0x00,0x00,0x00)) -Force



    #New-Item -Path "HKLM:SYSTEM\ControlSet001\Control\Video\$VideoID\0000\DAL3_DATA\common\$DisplayPath" -Force
    New-ItemProperty -Path "HKLM:SYSTEM\ControlSet001\Control\Video\$VideoID\0000\DAL3_DATA\common\$DisplayPath" -Name color_depth -Value ([byte[]]@(0x04,0x00,0x00,0x00)) -PropertyType Binary -Force
    #Set-ItemProperty -Path "HKLM:SYSTEM\ControlSet001\Control\Video\$VideoID\0000\DAL3_DATA\common\$DisplayPath" -Name color_depth -Value ([byte[]]@(0x02,0x00,0x00,0x00)) -Force
 
    #New-Item -Path "HKLM:SYSTEM\CurrentControlSet\Control\Video\$VideoID\0000\DAL3_DATA\common\$DisplayPath" -Force
    New-ItemProperty -Path "HKLM:SYSTEM\CurrentControlSet\Control\Video\$VideoID\0000\DAL3_DATA\common\$DisplayPath" -Name color_depth -Value ([byte[]]@(0x04,0x00,0x00,0x00)) -PropertyType Binary -Force
    #Set-ItemProperty -Path "HKLM:SYSTEM\CurrentControlSet\Control\Video\$VideoID\0000\DAL3_DATA\common\$DisplayPath" -Name color_depth -Value ([byte[]]@(0x02,0x00,0x00,0x00)) -Force

cmd /k 'pause'

i was doing some thinking and maybe the registry or powershell wants the Product and Manufacturer IDs to be in hexadecimal instead of decimal (EDID_3A59_1046_D32h-J09_12 vs EDID_14937_4166_D32h-J09_12). is there a way we can try to add it that way and see if it accepts it?
 

My Computer My Computer

At a glance

Windows 11 27965Intel i7 7700 @4.0ghz64gb DDR4Radeon RX 5500 XT
OS
Windows 11 27965
Computer type
PC/Desktop
CPU
Intel i7 7700 @4.0ghz
Memory
64gb DDR4
Graphics Card(s)
Radeon RX 5500 XT
Sound Card
Topping D50s
Hard Drives
NVMe
PSU
Corsair
Keyboard
Stelseries G6v2
Mouse
Zowie EC2
Other Info
https://www.youtube.com/shoober420
Registry doesn't care, it's just a blind data store. PS doesn't give a crap. Whatever app wants this data decides what's a valid key name for it to read.
 

My Computer My Computer

At a glance

Windows 7
OS
Windows 7
ive been trying to debug whats going on. it cant be permissions or outside control from Adrenalin software because if i manually put the EDID info at the end of the string it works.

i tried another string format type using + and discovered an error
Code:
$DisplayPath = $Manufacturer + $ProductID + $Model + $DisplayPathDigit

Cannot convert value "D32h-J09" to type "System.UInt32". Error: "Input string was not in a correct format."
At C:\Users\cr4ss\Downloads\wtfplease.ps1:49 char:5
+     $DisplayPath = $Manufacturer + $ProductID + $Model + $DisplayPath ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvalidCastFromStringToInteger

manually adding the $Model number works and applies the tweak

Code:
$DisplayPath = "EDID_{0}_{1}_D32h-J09_{2}" -f "$Manufacturer", "$ProductID", "$DisplayPathDigit"

$Model variable must be the culprit as to why it doesnt add the reg key
 

My Computer My Computer

At a glance

Windows 11 27965Intel i7 7700 @4.0ghz64gb DDR4Radeon RX 5500 XT
OS
Windows 11 27965
Computer type
PC/Desktop
CPU
Intel i7 7700 @4.0ghz
Memory
64gb DDR4
Graphics Card(s)
Radeon RX 5500 XT
Sound Card
Topping D50s
Hard Drives
NVMe
PSU
Corsair
Keyboard
Stelseries G6v2
Mouse
Zowie EC2
Other Info
https://www.youtube.com/shoober420
Oranges are not apples...

$DisplayPath = $Manufacturer + $ProductID + $Model + $DisplayPathDigit
$DisplayPath = [unsigned integer] + [unsigned integer] + [string] + [signed integer]

$DisplayPath = $Manufacturer.ToString() + '_' + $ProductID.ToString() + '_' + $Model + '_' + $DisplayPathDigit.ToString()
$DisplayPath = [string] + [string] + [string] + [string]

$DisplayPath = "EDID_{0}_{1}_D32h-J09_{2}" -f $Manufacturer, $ProductID, $DisplayPathDigit
$DisplayPath = "[formatted string expression]" -f value1, value2, value3
 

My Computer My Computer

At a glance

Windows 7
OS
Windows 7
making all the variables in the string format still doesnt add them to the registry properly. how can i make the $Model variable formatted correctly for the registry to accept it?

Code:
$DisplayPath = "EDID_{0}_{1}_{2}_{3}" -f $Manufacturer.ToString(), $ProductID.ToString(), $Model, $DisplayPathDigit.ToString()
 

My Computer My Computer

At a glance

Windows 11 27965Intel i7 7700 @4.0ghz64gb DDR4Radeon RX 5500 XT
OS
Windows 11 27965
Computer type
PC/Desktop
CPU
Intel i7 7700 @4.0ghz
Memory
64gb DDR4
Graphics Card(s)
Radeon RX 5500 XT
Sound Card
Topping D50s
Hard Drives
NVMe
PSU
Corsair
Keyboard
Stelseries G6v2
Mouse
Zowie EC2
Other Info
https://www.youtube.com/shoober420
@garlin
using

Code:
$DisplayPath = $Manufacturer.ToString() + '_' + $ProductID.ToString() + '_' + $Model + '_' + $DisplayPathDigit.ToString()
and adding EDID_$DisplayPath to the end of the reg keys also doesnt add it. the string reads correctly though.

is there a incorrect string conversion in the $Model variable code? i tried using utf7, unicode, and ansi but it still doesnt add the key

Code:
Model = ([System.Text.Encoding]::utf7.GetString($Monitor.UserFriendlyName[0..($Monitor.UserFriendlyNameLength -3)]) -split ' ')[0]

is there a way to convert it to "ToInt32" like with the $Manufacturer variable code?
 

My Computer My Computer

At a glance

Windows 11 27965Intel i7 7700 @4.0ghz64gb DDR4Radeon RX 5500 XT
OS
Windows 11 27965
Computer type
PC/Desktop
CPU
Intel i7 7700 @4.0ghz
Memory
64gb DDR4
Graphics Card(s)
Radeon RX 5500 XT
Sound Card
Topping D50s
Hard Drives
NVMe
PSU
Corsair
Keyboard
Stelseries G6v2
Mouse
Zowie EC2
Other Info
https://www.youtube.com/shoober420
@garlin
i discovered something just now. changing the $Monitor.UserFriendlyNameLength to -6 from -3 applies the tweak.

Code:
$Model = ([System.Text.Encoding]::ASCII.GetString($Monitor.UserFriendlyName[0..($Monitor.UserFriendlyNameLength -6)]) -split ' ')[0]

i also noticed that using the following code applies the tweak as well. 7 being how many symbols are in the $Model name
Code:
$Model = ([System.Text.Encoding]::ASCII.GetString($Monitor.UserFriendlyName[0..7]) -split ' ')[0]

using any other value for for -6 or 7 will not apply the reg key. is it possible for the $Model command to detect how many symbols are in the $Model name and apply the reg key? if the value is too high, it doesnt apply. if the value is too low, the model name is cut off and doesnt apply either
 

My Computer My Computer

At a glance

Windows 11 27965Intel i7 7700 @4.0ghz64gb DDR4Radeon RX 5500 XT
OS
Windows 11 27965
Computer type
PC/Desktop
CPU
Intel i7 7700 @4.0ghz
Memory
64gb DDR4
Graphics Card(s)
Radeon RX 5500 XT
Sound Card
Topping D50s
Hard Drives
NVMe
PSU
Corsair
Keyboard
Stelseries G6v2
Mouse
Zowie EC2
Other Info
https://www.youtube.com/shoober420
You're guessing here. The reg keys exist for a specific AMD driver, so you need other users to share what their keys look like. Trying to guess on a sample size of one (you) works up to a point.

Trust me, I've reverse-engineered a lot of weird stuff in my time. You need a 4-5 samples to know if your assumptions are correct or not.

If you don't have another display, why not haul your PC over to a friend's house and try their display?
 

My Computer My Computer

At a glance

Windows 7
OS
Windows 7
Back
Top Bottom