(v1.2 and beyond)but serial number is not 'required. the model number is required to be present 'according to the spec.
strRawEDID = "EDID Not Available" 'store an "unavailable message else for each bytevalue in arrintedid 'otherwise conver the byte array from the registry into a string (for easier processing later) strRawEDID = strRawEDID & chr ( bytevalue ) Next End If 'now take the string and store it in an array, that way we can support multiple monitors redim preserve strarrRawEDID ( intMonitorCount ) strarrRawEDID ( intMonitorCount ) = strRawEDID intMonitorCount = intMonitorCount + 1 End If Next End If Next Next Next '***************************************************************************************** 'now the EDID info for each active monitor is stored in an array of strings called strarrRawEDID 'so we can process it to get the good stuff out of it which we will store in a 5 dimensional array 'called arrMonitorInfo, the dimensions are as follows: '0=VESA Mfg ID, 1=VESA Device ID, 2=MFG Date (M/YYYY),3=Serial Num (If available),4=Model Descriptor '5=EDID Version '***************************************************************************************** On Error Resume Next dim arrMonitorInfo () redim arrMonitorInfo ( intMonitorCount - 1, 5 ) dim location ( 3 ) for tmpctr = 0 to intMonitorCount - 1 If strarrRawEDID ( tmpctr ) "EDID Not Available" then '********************************************************************* 'first get the model and serial numbers from the vesa descriptor 'blocks in the edid. GetBinaryValue HKLM, sbaseke圓 & "Device Parameters\", "EDID", arrintEDID If vartype ( arrintedid ) 8204 then 'and If we don't find it. EnumKey ( HKLM, sBaseKe圓, arSubKeys3 ) For Each sKe圓 In arSubKeys3 'Kaplan edit strRawEDID = "" If ske圓 = "Control" Then 'If the Control sub-key exists then we should read the edid info oRegistry. GetMultiStringValue HKLM, sBaseKey2 & sKey2 & "\", "HardwareID", sValue for tmpctr = 0 to ubound ( svalue ) If lcase ( left ( svalue ( tmpctr ), 8 )) = "monitor\" then 'If it is a monitor we will check for the existance of a control subkey 'that way we know it is an active monitor sBaseKe圓 = sBaseKey2 & sKey2 & "\" iRC3 = oRegistry. EnumKey ( HKLM, sBaseKey, arSubKeys ) For Each sKey In arSubKeys 'we are now in the registry at the level of: 'HKLM\SYSTEM\CurrentControlSet\Enum\DISPLAY\\ 'so we can check the "HardwareID" value oRegistry. Quit End If End If sBaseKey = "SYSTEM\CurrentControlSet\Enum\DISPLAY\" 'enumerate all the keys HKLM\SYSTEM\CurrentControlSet\Enum\DISPLAY\ iRC = oRegistry. Description, vbCritical + vbOKOnly, strComputer WScript. writeline "Computer,Model,Serial #,Vendor ID,Manufacture Date,Messages" End If End If Dim strarrRawEDID () intMonitorCount = 0 Const HKLM = & H80000002 'HKEY_LOCAL_MACHINE 'get a handle to the WMI registry object On Error Resume Next Set oRegistry = GetObject ( "winmgmts:!\\" & strComputer & "/root/default:StdRegProv" ) If Err 0 Then If batch Then EchoAndLog strComputer & "," & Err. OpenTextFile ( logfile, ForAppend, True ) If bHeader Then appendout. FileExists ( logfile ) Then bHeader = True set appendout = fso. ExpandEnvironmentStrings ( "%userprofile%" ) & "\desktop\MonitorInfo.csv" 'setup Log Const ForAppend = 8 Set fso = CreateObject ( "Scripting.FileSystemObject" ) If Not fso. Quit strComputer = UCase ( strComputer ) If batch Then Dim fso, logfile, appendout logfile = wshShell. ExpandEnvironmentStrings ( "" ) strComputer = InputBox ( "Check Monitor info for what PC", "PC Name?", strComputer ) End If If strcomputer = "" Then WScript.
Arguments ( 0 ) ' batch = True Else strComputer = wshShell. CreateObject ( "WScript.Shell" ) Dim strComputer, message Dim intMonitorCount Dim oRegistry, sBaseKey, sBaseKey2, sBaseKe圓, skey, skey2, ske圓 Dim sValue dim i, iRC, iRC2, iRC3 Dim arSubKeys, arSubKeys2, arSubKeys3, arrintEDID Dim strRawEDID Dim ByteValue, strSerFind, strMdlFind Dim intSerFoundAt, intMdlFoundAt, findit Dim tmp, tmpser, tmpmdl, tmpctr Dim batch, bHeader batch = False If WScript. Option Explicit Dim WshShell Set WshShell = WScript.