Using vb.net, I need to start a process without administrative privileges from a program running with administrative privileges.
There is lots of documentation on how to go about this the other way around (i.e. start a process with administrative privileges from a program running without administrative privileges), but none that I could find the other way around.
I tried omitting the .verb="runas", which I thought would be the simple answer, but doing that the new process gets started with the same administrative privileges as the current running program.
Here is the code I am using
Dim myProcess As New Process
With myProcess.StartInfo
.CreateNoWindow = True
.UseShellExecute = False
.WorkingDirectory = System.Environment.CurrentDirectory
.FileName = "aprogram.exe"
.Arguments = "Some stuff"
End With
Dim ProcessStarted As Boolean = myProcess.Start()
I have tried .UseShellExecute = true, and .UseSHellExecute = false.
I have a really wonky workaround that involves sending a message to a second program that is already running without administrative privileges to open up the program I need opened up without administrative privileges. However, I'm hoping there is an easier way.
Any help would be appreciated.