Hi zusammen,
ich hoffe Ihr könnt mir weiterhelfen. Ich muss in meiner Firma inventur machen, dazu gehört auch das Inventarisieren der Monitore. Wir benutzen hier Kixtart als Anmeldescript deswegen hab ich mal nach nem fertigen script gesucht was monitor infos auslesen kann.
Hab jetzt dieses Script gefunden.
Der Code funktioniert auch soweit wie er soll .. Also am ende krieg ich die drei wichtigsten Sachen raus : Typ, Herstellungs datum und SN. Nun möchte ich die ergebnisse in ein txt file auf unserem Fileserver abspeichern. Das Problem ist, ich hab absolut kein plan wie ich das Script umschreiben soll damit er das Ergbniss in ein txt file reinschreibt anstatt es in der Konsole auszugeben.
Ich hoffe ich habe mein Problem verständlich Formuliert und hoffe hiermit auf hilfe von eurer seite
Gruß
Walter
ich hoffe Ihr könnt mir weiterhelfen. Ich muss in meiner Firma inventur machen, dazu gehört auch das Inventarisieren der Monitore. Wir benutzen hier Kixtart als Anmeldescript deswegen hab ich mal nach nem fertigen script gesucht was monitor infos auslesen kann.
Hab jetzt dieses Script gefunden.
Code:
; Return monitor info.
Break ON
$=SetOption("Explicit","ON")
$=SetOption("WrapAtEOL","ON")
$=SetOption("ASCII","ON")
GLOBAL $VERBOSE
$VERBOSE=1 ; Set to "0" to disable debug info
Dim $KEY_DISPLAY
Dim $iIndexPri,$iIndexSub
Dim $sMonitor,$sDevice
$KEY_DISPLAY="HKLM\SYSTEM\CurrentControlSet\Enum\Display"
; Iterate through possible displays.
Log(Log("Starting scan for monitor info..."))
$iIndexPri=0
While Not @ERROR
$sMonitor=EnumKey($KEY_DISPLAY,$iIndexPri)
$sMonitor=$KEY_DISPLAY+"\"+$sMonitor
Log("--------------------------------------------")
Log("Primary key is '"+$sMonitor+"'")
$iIndexSub=0
$sDevice=EnumKey($sMonitor,$iIndexSub)
while Not @ERROR
$sDevice=$sMonitor+"\"+$sDevice
Log(" Secondary key is '"+$sDevice+"'")
If KeyExist($sDevice+"\Control")
Log(" Control found - device assumed to be active")
If Instr(ReadValue($sDevice,"HardwareID"),"Monitor\")=1
Log(" Device type is monitor.")
ParseEDID(ReadValue($sDevice+"\Device Parameters","EDID"))
Else
Log(" Device type is not monitor.")
EndIf
Else
Log(" Control not found - device assumed to be inactive")
EndIf
$iIndexSub=$iIndexSub+1
$sDevice=EnumKey($sMonitor,$iIndexSub)
Loop
$iIndexPri=$iIndexPri+1
$sMonitor=EnumKey($KEY_DISPLAY,$iIndexPri)
Loop
Log("Completed scan for monitor info.")
Exit 0
Function ParseEDID($sEDID)
Dim $iOffset, $sBlock
If $sEDID=""
Log(" No EDID information associated with device")
Exit 0
EndIf
; Check for valid EDID data
If SubStr($sEDID,1,16)="00ffffffffffff00"
Log(" EDID signature is valid")
Else
Log(" EDID signature is invalid: "+SubStr($sEDID,1,16))
Exit 0
EndIf
Log(" "+$sEDID)
Log(" EDID Version number is "
+Execute("Exit &"+SubStr($sEDID,(&12+1)*2-1,2))
+"."
+Execute("Exit &"+SubStr($sEDID,(&13+1)*2-1,2)))
; Look for serial number and model number in descriptor blocks.
For $iOffset=54 To 108 Step 18
$sBlock=SubStr($sEDID,$iOffset*2+1,18*2)
Select
Case Left($sBlock,8)="000000fc"
" Model: "
Bin2Str(SubStr($sBlock,9)) ?
Case Left($sBlock,8)="000000fe"
" Other info: "
Bin2Str(SubStr($sBlock,9)) ?
Case Left($sBlock,8)="000000ff"
"EDID 1.3 Serial number: "
Bin2Str(SubStr($sBlock,9)) ?
Case "Unknown type"
Log(" Unknown type: "+Left($sBlock,8))
EndSelect
Next
"EDID 1.2 Serial number: "+Execute("Exit &"+SubStr($sEDID,(&1C+1)*2-1,8))+@CRLF
" Week of manufacture: "+Execute("Exit &"+SubStr($sEDID,(&10+1)*2-1,2))+@CRLF
" Year of manufacture: "+(1990+Execute("Exit &"+SubStr($sEDID,(&11+1)*2-1,2)))+@CRLF
EndFunction
Function Bin2Str($s)
Dim $c
While $s
$c=Execute("Exit &"+Left($s,2))
; Truncate string at CR
If $c=10 Exit 0 EndIf
iF $c $Bin2Str=$Bin2Str+Chr($c) EndIf
$s=SubStr($s,3)
Loop
Exit 0
EndFunction
Function Log($s)
If $VERBOSE @DATE+" "+@TIME+" "+$s+@CRLF EndIf
Exit 0
EndFunction
Der Code funktioniert auch soweit wie er soll .. Also am ende krieg ich die drei wichtigsten Sachen raus : Typ, Herstellungs datum und SN. Nun möchte ich die ergebnisse in ein txt file auf unserem Fileserver abspeichern. Das Problem ist, ich hab absolut kein plan wie ich das Script umschreiben soll damit er das Ergbniss in ein txt file reinschreibt anstatt es in der Konsole auszugeben.
Ich hoffe ich habe mein Problem verständlich Formuliert und hoffe hiermit auf hilfe von eurer seite

Gruß
Walter