I'm using C# with .NET 3.5
My goal here is to take the logged in user name and simply start a process under this user name. Normally a simple Process.Start(pathToProgram)
would help here, but the problem is that I'm calling this line from an installer class, meaning the msiexec is currently working and the user name i get is SYSTEM instead of the actual user who currently logged in to windows.
Of course that Environment.UserName
also returns "SYSTEM" instead of the logged in user.
How can I start the process as the logged in user and not as the user SYSTEM?