von Martin98 » 11.07.2022, 14:24
DK2000 hat geschrieben: 26.06.2022, 13:48
Der Befehl ist schon richtig geschrieben, nur hat sc keine Rechte, an der Konfiguration des Dienstes etwas zu ändern, egal mit welchen Rechten es ausgeführt wird. Leider hat das Tool aber auch keine Rechte, den Besitz oder die Rechte an dem Dienst zu ändern. Das Endet alles mit "Zugriff verweigert".
Kannst höchstens versuchen, den Wert in der Registry mittels reg.exe direkt zu ändern.
ok, DK2000 noch eine kurze Frage, kannst du mir sagen warum ich 3 Keys in der .reg habe
Code: Alles auswählen
Windows 10 Pro 21H2 19044.1806 - Retail (ohne OEM-Key im Bios)
######################################################################
Key1="HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\BackupProductKeyDefault"
Key2="HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DefaultProductKey\DigitalProductId"
Key3="HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DefaultProductKey2\DigitalProductId"
######################################################################
######################################################################
key2.vbs
######################################################################
Set WshShell = CreateObject("WScript.Shell")
MsgBox ConvertToKey(WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DefaultProductKey\DigitalProductId"))
Function ConvertToKey(Key)
Const KeyOffset = 52
i = 28
Chars = "BCDFGHJKMPQRTVWXY2346789"
Do
Cur = 0
x = 14
Do
Cur = Cur * 256
Cur = Key(x + KeyOffset) + Cur
Key(x + KeyOffset) = (Cur \ 24) And 255
Cur = Cur Mod 24
x = x -1
Loop While x >= 0
i = i -1
KeyOutput = Mid(Chars, Cur + 1, 1) & KeyOutput
If (((29 - i) Mod 6) = 0) And (i <> -1) Then
i = i -1
KeyOutput = "-" & KeyOutput
End If
Loop While i >= 0
ConvertToKey = KeyOutput
End Function
######################################################################
key3.vbs
######################################################################
Set WshShell = CreateObject("WScript.Shell")
MsgBox ConvertToKey(WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DefaultProductKey2\DigitalProductId"))
Function ConvertToKey(Key)
Const KeyOffset = 52
i = 28
Chars = "BCDFGHJKMPQRTVWXY2346789"
Do
Cur = 0
x = 14
Do
Cur = Cur * 256
Cur = Key(x + KeyOffset) + Cur
Key(x + KeyOffset) = (Cur \ 24) And 255
Cur = Cur Mod 24
x = x -1
Loop While x >= 0
i = i -1
KeyOutput = Mid(Chars, Cur + 1, 1) & KeyOutput
If (((29 - i) Mod 6) = 0) And (i <> -1) Then
i = i -1
KeyOutput = "-" & KeyOutput
End If
Loop While i >= 0
ConvertToKey = KeyOutput
End Function
[quote=DK2000 post_id=392154 time=1656244106 user_id=39966]
Der Befehl ist schon richtig geschrieben, nur hat sc keine Rechte, an der Konfiguration des Dienstes etwas zu ändern, egal mit welchen Rechten es ausgeführt wird. Leider hat das Tool aber auch keine Rechte, den Besitz oder die Rechte an dem Dienst zu ändern. Das Endet alles mit "Zugriff verweigert".
Kannst höchstens versuchen, den Wert in der Registry mittels reg.exe direkt zu ändern.
[/quote]
ok, DK2000 noch eine kurze Frage, kannst du mir sagen warum ich 3 Keys in der .reg habe
[code]
Windows 10 Pro 21H2 19044.1806 - Retail (ohne OEM-Key im Bios)
######################################################################
Key1="HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\BackupProductKeyDefault"
Key2="HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DefaultProductKey\DigitalProductId"
Key3="HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DefaultProductKey2\DigitalProductId"
######################################################################
######################################################################
key2.vbs
######################################################################
Set WshShell = CreateObject("WScript.Shell")
MsgBox ConvertToKey(WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DefaultProductKey\DigitalProductId"))
Function ConvertToKey(Key)
Const KeyOffset = 52
i = 28
Chars = "BCDFGHJKMPQRTVWXY2346789"
Do
Cur = 0
x = 14
Do
Cur = Cur * 256
Cur = Key(x + KeyOffset) + Cur
Key(x + KeyOffset) = (Cur \ 24) And 255
Cur = Cur Mod 24
x = x -1
Loop While x >= 0
i = i -1
KeyOutput = Mid(Chars, Cur + 1, 1) & KeyOutput
If (((29 - i) Mod 6) = 0) And (i <> -1) Then
i = i -1
KeyOutput = "-" & KeyOutput
End If
Loop While i >= 0
ConvertToKey = KeyOutput
End Function
######################################################################
key3.vbs
######################################################################
Set WshShell = CreateObject("WScript.Shell")
MsgBox ConvertToKey(WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DefaultProductKey2\DigitalProductId"))
Function ConvertToKey(Key)
Const KeyOffset = 52
i = 28
Chars = "BCDFGHJKMPQRTVWXY2346789"
Do
Cur = 0
x = 14
Do
Cur = Cur * 256
Cur = Key(x + KeyOffset) + Cur
Key(x + KeyOffset) = (Cur \ 24) And 255
Cur = Cur Mod 24
x = x -1
Loop While x >= 0
i = i -1
KeyOutput = Mid(Chars, Cur + 1, 1) & KeyOutput
If (((29 - i) Mod 6) = 0) And (i <> -1) Then
i = i -1
KeyOutput = "-" & KeyOutput
End If
Loop While i >= 0
ConvertToKey = KeyOutput
End Function
[/code]