You need to change / read / add the Shell variable in the Windows registry along the path \ HKEY_USERS \\ Software \ Microsoft \ Windows NT \ CurrentVersion \ Winlogon for each user. However, only users who are logged in are located in \ HKEY_USERS \. If I correctly understood from the articles on the Internet, then I need to load user hives into the registry stored in C: \ Users \ <Username> \ NTUSER.DAT, which I tried to do:
[DllImport("advapi32.dll", SetLastError = true)] static extern Int32 RegLoadKey(UInt32 hKey, String lpSubKey, String lpFile); public enum HKEY : uint { LOCAL_MACHINE = 0x80000002, USERS = 0x80000003 } static void LoadUserHive() { string path = "C:\\Users\\Max\\NTUSER.DAT"; string SID = "S-1-5-21-2185061059-2250993091-2609513880-1001"; RegLoadKey((uint)HKEY.USERS, SID, path); } The code runs without errors, but the user’s hive in \ HKEY_USERS \ is not observed.
Tell me what I'm doing wrong
куст пользователя? - tym32167Maxfrom the issue is good, it is turned on and not interactive. As for the option with the Task Scheduler, it will not work, since in addition to the recording, the program also needs to read this variable [Shell along the path \ HKEY_USERS \\ Software \ Microsoft \ Windows NT \ CurrentVersion \ Winlogon] (I'm sorry, I forgot to specify in the question ) - svolex