Ich habe ein Skript geschrieben, welches die Windows und Office-Keys aller unserer Rechner in der Firma ausliest und in eine Datei speichert. Die Funktion für die Office-Keys habe ich hier aus dem Forum. Ich habe sie nur leicht angepasst.
Spoiler anzeigen
Func getOfficeKey()
Local $List[1]
Local $i = 1
$var = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\11.0\Common\InstallRoot", "Path")
If $var <> "" Then
$product = "2003"
Dim $officeKey = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\11.0\Registration"
Else
$var = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\10.0\Common\InstallRoot", "Path")
If @error <> 0 Then
GUICtrlSetData($status_L, "Info: Unable to find installationPath, maybe no Office installed!")
Return "No Office XP or 2003 found"
EndIf
If $var <> "" Then
$product = "XP"
Dim $officeKey = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\10.0\Registration"
EndIf
EndIf
Dim $var = RegEnumKey($officeKey, $i)
If @error <> 0 Then
GUICtrlSetData($status_L, "Info: Unable to find REG_BINARY 'DigitalProductID', maybe no Office installed!")
Return "No Office XP or 2003 found"
Else
$List[$i - 1] = RegRead($officeKey & "\" & $var, "DigitalProductID")
If $List[$i - 1] = "" Then
GUICtrlSetData($status_L, "Info: Unable to find REG_BINARY 'DigitalProductID', maybe no Office installed!")
Else
$key = $List[$i - 1]
Return DecodeProductKey($key)
EndIf
EndIf
EndFunc ;==>getOfficeKey
Jetzt ist das Problem, dass demnach mind. die Hälfte der Rechner mit Office mit dem selben Key installiert wurden. Um genau zu sein 58 mal. Wir haben allerdings nur OEM Lizenzen. D.h. jeder Key dürfte eigentlich nur einmal auftauchen. Irgendwie hab ich das Gefühl, dass die Funktion nicht ganz korrekt ist.