rover Posted May 29, 2009 Share Posted May 29, 2009 (edited) thank you for this rover! ive been using this with some success... can you or anyone else figure out a way i can get a more complete serial number? from what i could tell it only ouputs the last 8 characters (and the serial is in most cases what im seeing 14 characters) good timing gcue have you had a look at the serial length in the binary EDID in the registry? HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\DISPLAY\'YOUR VESA ID'\'MONITOR CODE'\Device Parameters\EDID script needs an update, though still works without it as of version 3.3.0.0 RegRead now returns binary instead of hex string added Hex() to RegRead return. tested with old Dell P992 with 12 digit serial number try changing the For/Next loop count value in _FindMonitorSerial() (set to 13, try 20) 13 is probably the v1.3 EDID standard length for the serial, as the vb scripts in the above link uses 13 see the above post where Dell monitor serial numbers are shorter in the registry. Edit: I just noticed my post count is 486. I feel like I have the clock speed of a 486 today... CODE; Retrieve Monitor Model and Serial ; 13 November 2005 by Geert (NL) ; used parts made by archrival (http://www.autoitscript.com/forum/index.php?showtopic=11136) ; Edited/upgraded by rover 20 June 2008 ; Collect EDID strings for all active monitors ;Links ;http://en.wikipedia.org/wiki/Extended_display_identification_data ;http://www.lavalys.com/forum/lofiversion/index.php/t1829.html ;http://cwashington.netreach.net/depo/view.asp?Index=1087&ScriptType=vbscript #AutoIt3Wrapper_Au3Check_Parameters= -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 Opt("MustDeclareVars", 1) ;#include <Constants.au3> ; ConsoleWrites slow a script if not needed Global $bDebug = True ; change to False or comment out/remove ConsoleWrite() lines if debugging to console not needed Global $bDisplayAll = False ; if false only 'Active' monitors (reg entries with 'Control' key) with EDID info reported ; 'Active' monitors with no reported EDID data(serial, name, date) are ignored Global $asEDID[1][2] = [[0, 0]] Global $iCounterEDID = 0, $sResults Global $edidarray[1], $error1, $error2, $error3 Global $iCounterMonitorName = 1, $iCounterMonitorCode, $iCounterMonitorControlFolder Global $sMonitorName, $sMonitorCode, $sMonitorControlFolder, $bMonitorEDIDRead Global $ser, $name, $j, $sManuDate, $sEDIDVer, $iExtended Do $sMonitorName = RegEnumKey("HKLM\SYSTEM\CurrentControlSet\Enum\DISPLAY", $iCounterMonitorName) $error1 = @error If $bDebug Then ConsoleWrite(@CRLF & '@@ Debug(' & @ScriptLineNumber & ') : $sMonitorName = ' & _ StringStripWS($sMonitorName, 2) & @CRLF & '>Error code: ' & $error1 & @CRLF) If $sMonitorName <> "" Then $iCounterMonitorCode = 1 Do ; Search 'monitor code' - e.g. 5&3aba5caf&0&10000080&01&00 $sMonitorCode = RegEnumKey("HKLM\SYSTEM\CurrentControlSet\Enum\DISPLAY\" & _ $sMonitorName, $iCounterMonitorCode) $error2 = @error If $bDebug Then ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $sMonitorCode = ' & _ StringStripWS($sMonitorCode, 2) & @CRLF & '>Error code: ' & $error2 & @CRLF) ; Search Control folder - When available, the active monitor is found $iCounterMonitorControlFolder = 1 Do $sMonitorControlFolder = RegEnumKey("HKLM\SYSTEM\CurrentControlSet\Enum\DISPLAY\" & _ $sMonitorName & "\" & $sMonitorCode, $iCounterMonitorControlFolder) $error3 = @error If $bDebug Then ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $sMonitorControlFolder = ' & _ StringStripWS($sMonitorControlFolder, 2) & @CRLF & '>Error code: ' & $error3 & @CRLF) If $sMonitorControlFolder == "Control" Then; Active monitor found! Switch RegEnumVal("HKLM\SYSTEM\CurrentControlSet\Enum\DISPLAY\" & $sMonitorName & _ "\" & $sMonitorCode & "\Device Parameters", 1) Case "EDID" $bMonitorEDIDRead = RegRead("HKLM\SYSTEM\CurrentControlSet\Enum\DISPLAY\" & _ $sMonitorName & "\" & $sMonitorCode & "\Device Parameters", "EDID") $iExtended = @extended If $bDebug Then ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $bMonitorEDIDRead = ' & _ $bMonitorEDIDRead & @CRLF & '>Error code: ' & @error & @CRLF & '>Extended code: ' & $iExtended & @CRLF) ;If $bMonitorEDIDRead <> "" And Not @error And $iExtended = $REG_BINARY Then If $bMonitorEDIDRead <> "" And Not @error Then $iCounterEDID += 1 $asEDID[0][0] = $iCounterEDID ReDim $asEDID[uBound($asEDID) + 1][2] ; Add found EDID string to Array $asEDID[uBound($asEDID) - 1][0] = Hex($bMonitorEDIDRead) ;(convert from binary to hex string: AutoIt v3.3.0.0 and higher) $asEDID[uBound($asEDID) - 1][1] = $sMonitorName EndIf Case "BAD_EDID" $iCounterEDID += 1 $asEDID[0][0] = $iCounterEDID ReDim $asEDID[uBound($asEDID) + 1][2] $asEDID[uBound($asEDID) - 1][0] = "BAD_EDID"; Add BAD_EDID string to Array $asEDID[uBound($asEDID) - 1][1] = $sMonitorName EndSwitch EndIf $iCounterMonitorControlFolder += 1; Increase counter to search for next folder Until $error3 <> 0 $iCounterMonitorCode += 1; Increase counter to search for next 'monitor code' folder Until $error2 <> 0 EndIf $iCounterMonitorName += 1; Increase counter to search for next monitor Until $error1 <> 0 ; Extract info from collected EDID strings - Thanks archrival If $asEDID[0][0] Then For $k = 1 To $asEDID[0][0] Switch $asEDID[$k][0] Case "BAD_EDID" If Not $bDisplayAll Then ContinueLoop $ser = "BAD_EDID" $name = "BAD_EDID" Case Else $j = 0 ReDim $edidarray[stringLen($asEDID[$k][0])] $edidarray[0] = (StringLen($asEDID[$k][0]) / 2) + 1 For $i = 1 To StringLen($asEDID[$k][0]) Step 2 $j += 1 $edidarray[$j] = Dec(StringMid($asEDID[$k][0], $i, 2)) Next $ser = StringStripWS(_FindMonitorSerial($edidarray), 1 + 2) $name = StringStripWS(_FindMonitorName($edidarray), 1 + 2) If $name <> "Not Found" Then $sManuDate = StringStripWS(_FindMonitorManuDate($asEDID[$k][0]), 1 + 2) $sEDIDVer = StringStripWS(_FindMonitorEDIDVer($asEDID[$k][0]), 1 + 2) Else $sManuDate = "" $sEDIDVer = "" EndIf If Not $bDisplayAll Then If $name = "Not Found" Then ContinueLoop EndIf EndSwitch $sResults &= @CRLF & "Monitor #" & $k & @CRLF & "VESA Monitor ID" & @TAB & $asEDID[$k][1] & @CRLF & _ "Serial: " & @TAB & @TAB & $ser & @CRLF & "Name: " & @TAB & @TAB & $name & @CRLF & _ "ManuDate: " & @TAB & $sManuDate & @CRLF & "EDID: " & @TAB & @TAB & $sEDIDVer & @CRLF Next Else ; No EDID or BAD_EDID entries found $sResults = "No Monitors Found" EndIf ;Show MonitorSerial & MonitorName: no info? -> Your using a notebook right! MsgBox(64, "Active Monitor EDID Info", $sResults) Exit #Region - Functions Func _FindMonitorSerial(ByRef $aArray); Thanks archrival If Not IsArray($aArray) Then Return Local $sSernumstr = "", $iSernum = 0, $iEndstr = 0 For $i = 1 To (UBound($aArray) / 2) - 4 If $aArray[$i] = "0" And $aArray[$i + 1] = "0" And $aArray[$i + 2] = "0" _ And $aArray[$i + 3] = "255" And $aArray[$i + 4] = "0" Then $iSernum = $i + 4 EndIf Next If $iSernum Then For $i = 1 To 13 ;try changing 13 to higher number If $aArray[$iSernum + $i] = "10" Then $iEndstr = 1 ElseIf Not $iEndstr Then $sSernumstr &= Chr($aArray[$iSernum + $i]) EndIf Next Else Return "Not Found" EndIf Return $sSernumstr EndFunc ;==>_FindMonitorSerial Func _FindMonitorName(ByRef $aArray); Thanks archrival If Not IsArray($aArray) Then Return Local $n = 0, $sNamestr = "", $iEndstr = 0 For $i = 1 To (UBound($aArray) / 2) - 4 If $aArray[$i] = "0" And $aArray[$i + 1] = "0" And _ $aArray[$i + 2] = "252" And $aArray[$i + 3] = "0" Then $n = $i + 3 EndIf Next If $n Then For $i = 1 To 13 If $aArray[$n + $i] = "10" Then $iEndstr = 1 ElseIf Not $iEndstr Then $sNamestr &= Chr($aArray[$n + $i]) EndIf Next Else Return "Not Found" EndIf Return $sNamestr EndFunc ;==>_FindMonitorName #EndRegion - Functions Func _FindMonitorManuDate(ByRef $sEDID) Local $wk, $yr $wk = Dec(StringMid($sEDID, 33, 2)) ; 10h BYTE week number of manufacture $yr = Dec(StringMid($sEDID, 35, 2)) + 1990 ; 11h BYTE manufacture year - 1990 If $wk = 0 Or $wk > 52 Or $yr < 2000 Or $yr > @YEAR Then Return "" EndIf Return "Week " & $wk & "/" & $yr EndFunc ;==>_FindMonitorManuDate Func _FindMonitorEDIDVer(ByRef $sEDID) Local $iEDIDVer, $iEDIDRev $iEDIDVer = Dec(StringMid($sEDID, 37, 2)) ; 12h BYTE EDID version $iEDIDRev = Dec(StringMid($sEDID, 39, 2)) ; 13h BYTE EDID revision If $iEDIDVer < 1 Or $iEDIDRev < 2 Then Return "" EndIf Return "v" & $iEDIDVer & "." & $iEDIDRev EndFunc ;==>_FindMonitorEDIDVer Edited May 29, 2009 by rover I see fascists... Link to comment Share on other sites More sharing options...
gcue Posted May 29, 2009 Share Posted May 29, 2009 heh funny i tried replacing 13 with 20 in the old script and the new one.. still getting 10 characters only =/ Link to comment Share on other sites More sharing options...
rover Posted May 29, 2009 Share Posted May 29, 2009 heh funny i tried replacing 13 with 20 in the old script and the new one.. still getting 10 characters only =/then that is the serial as stored in registry without the manufacturers prefix codeis it a Dell? I see fascists... Link to comment Share on other sites More sharing options...
gcue Posted May 29, 2009 Share Posted May 29, 2009 nah samsung.. hmm and it does say v1.3 hmm but the serial on the monitor is 14 chars... Link to comment Share on other sites More sharing options...
rover Posted May 29, 2009 Share Posted May 29, 2009 (edited) nah samsung.. hmm and it does say v1.3 hmm but the serial on the monitor is 14 chars...post the prefix section of the monitor sticker serial missing from the registry serialIt may turn up results in a google searchprobably the same as a Dell, the missing prefix is same for that modelEdit: to clarify, only the unique part of the serial number is stored, the sticker has a manufacturers prefix for that model added to the serial Edited May 29, 2009 by rover I see fascists... Link to comment Share on other sites More sharing options...
gcue Posted May 29, 2009 Share Posted May 29, 2009 what are you doing with the dell prefix? Link to comment Share on other sites More sharing options...
rover Posted May 29, 2009 Share Posted May 29, 2009 (edited) what are you doing with the dell prefix?nothing at allthe EDID standard seems to be limited to 13 characters so manufacturers using a long serial number don'twrite the entire thing into the monitors SEEPROM.DumpEDID and the Entech utility mentioned earlier in this threadshow the same thing, you can get the serial straight from the monitor or read it from the registry but you wont get the entire serial as shown on the monitor stickercase in point: my off-lease surplus Dell P992 monitor - DumpEDID and Entech utilities report 12 digit serial, so does the registrythe monitors sticker shows a 20 character serial number, not counting hyphensRegistry and read from monitor utilities: 8D46621930GUSticker: MX-08D466-47741-219-30GUthe serial has a monitor model specific prefix and an additional number in the middle of the serial!the industry standard seems to be no standard as I mentioned earlier in this threadEdit: correction SEEPROM not EEPROM, typos Edited May 29, 2009 by rover I see fascists... Link to comment Share on other sites More sharing options...
gcue Posted May 29, 2009 Share Posted May 29, 2009 very helpful info! many thanks =) Link to comment Share on other sites More sharing options...
rover Posted May 29, 2009 Share Posted May 29, 2009 very helpful info!many thanks =)no problem I see fascists... Link to comment Share on other sites More sharing options...
bonnerboy Posted December 30, 2009 Share Posted December 30, 2009 Hello Rover, your script is perfekt for me. Can you expplain how i can use this script in a network and then save the results in a txt or csv? I have to scan 600 Monitors and i realy have no idee how to do it without your skript.. Thanks Link to comment Share on other sites More sharing options...
JCO Posted February 9, 2010 Share Posted February 9, 2010 (edited) Wondering if there is any way to identify whether a monitor is TFT/LCD or CRT? Unfortunately I have to do some googling to determine the type of monitor given the monitor name. Any help would be appreciated. JCO Edited February 9, 2010 by JCO Link to comment Share on other sites More sharing options...
MysticEmpires Posted April 15, 2010 Share Posted April 15, 2010 (edited) There is a bug in the Function "_FindMonitorName". EDID allow mutible Discriptionblocks. A Sample : EDID : 00ffffffffffff003ac4000e000000002d0c010380201400eaa8e099574b92251c5054000000010101010101010101010101010101016c2f90a0601a1e403020260042c910000018000000fc004e76696469612044656661756c000000fc007420466c61742050616e656c00000000fd00003c1d430d000020202020200000540000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 Descriptor Block 1 : Pixel Clock Descriptor Block 2 : Monitorname Part 1(Nvidia Defaul) Descriptor Block 3 : Monitorname Part 2 (t Flat Panel) Descriptor Block 4 : Monitor Range Limits The old Version of the Function return : "t Flat Panel" the new Return : "Nvidia Default Flat Panel" Func _FindMonitorName(ByRef $aArray); Thanks archrival If Not IsArray($aArray) Then Return Local $n = 0, $sNamestr = "", $iEndstr = 0 For $i = 1 To (UBound($aArray) / 2) - 4 If $aArray[$i] = "0" And $aArray[$i + 1] = "0" And _ $aArray[$i + 2] = "252" And $aArray[$i + 3] = "0" Then $n = $i + 3 For $in = 1 To 13 If $aArray[$n + $in] = "10" Then $iEndstr = 1 ElseIf Not $iEndstr Then $sNamestr &= Chr($aArray[$n + $in]) EndIf Next EndIf Next If Not $n Then Return "Not Found" EndIf Return $sNamestr EndFunc ;==>_FindMonitorName Edited April 15, 2010 by MysticEmpires Link to comment Share on other sites More sharing options...
Scripter59 Posted November 11, 2010 Share Posted November 11, 2010 Larry, that would be great!!!I think it could be a great thing for all, who make asset...Hi all,question: is it possible to save the result to a file (ex. txt or csv) because I want to scan 100 computers?Thanks a lotScripter59 Link to comment Share on other sites More sharing options...
lbw87 Posted May 16, 2011 Share Posted May 16, 2011 this code works fine on XP but doesn't work on Win7 Can anyone fix this to run on Win7? Link to comment Share on other sites More sharing options...
Jac Posted May 15, 2014 Share Posted May 15, 2014 Hey can someone help me with Windows 8.1 The control key is not theere anymore in the registry Any others way to get the serial number ??? Thanks for your help Link to comment Share on other sites More sharing options...
Palestinian Posted May 16, 2014 Share Posted May 16, 2014 Perhaps its because Windows 8 didn't even exist when the last comment was made in this topic? please check the date of posts before replying. Link to comment Share on other sites More sharing options...
Jac Posted May 20, 2014 Share Posted May 20, 2014 Calm down I know that...i was wondering if someone knew a way to get this information with Windows 8Â That's all Link to comment Share on other sites More sharing options...
Palestinian Posted May 21, 2014 Share Posted May 21, 2014 Then create a new topic and link it to this one for reference, don't necro post. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now