Hello,
i have an .exe file which is needed to be started initially as SYSTEM user.
This .exe is calling another instance(copy) of itself, but in user context so that interactive actions can be done (in this case showing a Toast Notification).
Do you have an idea how the first instance of my program can start itself as a second instance from SYSTEM context in user/interactive mode without loosing access to Registry/HKLM ?
Maybe there is an alternative to Registry/HKLM? I just want to share data between the system process and user/interactive process, both need to have read/write access to a common data basis.
I'm new to C#, so i have no idea about alternatives.
Thank you very much!
Best regards
Emanuel
What I have tried:
In Visual Studio 2017 i used StartAsCurrentUser.exe (
GitHub - clreinki/StartAsCurrentUser: A simple EXE to utilize the functionality found in https://github.com/murrayju/CreateProcessAsUser to launch another EXE as currently logged in user[
^]. And it worked well. Both processes had access to Registry/HKLM.
Now i had to switch to Visual Studio 2019, and it does not work anymore.
If the second process (in interactive mode, startet by StartAsCurrentUser.exe) tries to write a key in the Registry (HKLM), i get the error "Access to the registry key 'HKEY_LOCAL_MACHINE\SOFTWARE\RSMGMT\Apps\TestSystemUser' is denied.