userlogin.opsi HKCU Key auslesen
Verfasst: 07 Dez 2022, 17:30
Moin,
ich möchte den Speicherort des Verzeichnisses Dokumente ermitteln, ob umgeleitet oder nicht.
Führe ich mein Script lokal mit Winst32.ee aus bekomme ich folgendes Ergebnis:
LogLevel set to 8
Defined global local string var: $personal$ with value:
Set $Personal$ = GetRegistryStringvalue("[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders] Personal")
key0 = HKEY_CURRENT_USER
Registry started readonly
Registry started with redirection (32 Bit)
Registry key [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders] opened
Key closed
The value of the variable "$Personal$" is now: "\\qnap01\homes\Administrator\Dokumente"
Das ist genau was ich möchte.
Wird das Script nach der Benutzeranmeldung ausgeführt, sieht es so aus:
(733) [6] [2022-12-07 16:07:38.569] [arduino-ide] LogLevel set to 8
(736) [7] [2022-12-07 16:07:38.569] [arduino-ide] Running loginscripts: key0 is now: HKEY_USERS, key is now: S-1-5-21-123533997-709188700-1805878784-500\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders
(737) [7] [2022-12-07 16:07:38.569] [arduino-ide] Registry started readonly
(738) [7] [2022-12-07 16:07:38.569] [arduino-ide] Registry started with redirection (32 Bit)
(739) [5] [2022-12-07 16:07:38.569] [arduino-ide] Registry key [HKEY_USERS\S-1-5-21-123533997-709188700-1805878784-500\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders] does not exist
(740) [6] [2022-12-07 16:07:38.569] [arduino-ide] The value of the variable "$Personal$" is now: ""
Die SID existiert gar nicht in der Registry ...
Auch die Versuche mit diesen Abfragen schlagen fehl:
set $Personal$ = GetRegistryStringValue64("[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders] Personal")
set $Personal$ = GetRegistryStringValueSysNative("[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders] Personal")
Gefunden habe ich auch die Option für WinBatch_xxx /RunAsLoggedonUser, leider ist das nicht in userlogin.opsi unterstützt.
Wo liegt mein Fehler?
ich möchte den Speicherort des Verzeichnisses Dokumente ermitteln, ob umgeleitet oder nicht.
Führe ich mein Script lokal mit Winst32.ee aus bekomme ich folgendes Ergebnis:
LogLevel set to 8
Defined global local string var: $personal$ with value:
Set $Personal$ = GetRegistryStringvalue("[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders] Personal")
key0 = HKEY_CURRENT_USER
Registry started readonly
Registry started with redirection (32 Bit)
Registry key [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders] opened
Key closed
The value of the variable "$Personal$" is now: "\\qnap01\homes\Administrator\Dokumente"
Das ist genau was ich möchte.
Wird das Script nach der Benutzeranmeldung ausgeführt, sieht es so aus:
(733) [6] [2022-12-07 16:07:38.569] [arduino-ide] LogLevel set to 8
(736) [7] [2022-12-07 16:07:38.569] [arduino-ide] Running loginscripts: key0 is now: HKEY_USERS, key is now: S-1-5-21-123533997-709188700-1805878784-500\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders
(737) [7] [2022-12-07 16:07:38.569] [arduino-ide] Registry started readonly
(738) [7] [2022-12-07 16:07:38.569] [arduino-ide] Registry started with redirection (32 Bit)
(739) [5] [2022-12-07 16:07:38.569] [arduino-ide] Registry key [HKEY_USERS\S-1-5-21-123533997-709188700-1805878784-500\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders] does not exist
(740) [6] [2022-12-07 16:07:38.569] [arduino-ide] The value of the variable "$Personal$" is now: ""
Die SID existiert gar nicht in der Registry ...
Auch die Versuche mit diesen Abfragen schlagen fehl:
set $Personal$ = GetRegistryStringValue64("[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders] Personal")
set $Personal$ = GetRegistryStringValueSysNative("[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders] Personal")
Gefunden habe ich auch die Option für WinBatch_xxx /RunAsLoggedonUser, leider ist das nicht in userlogin.opsi unterstützt.
Wo liegt mein Fehler?