0

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.

Rob
  • 3,488
  • 3
  • 32
  • 27
  • you are on the other side of the airlock. you can't do this. – Daniel A. White Jan 05 '18 at 21:12
  • There might be a clue [here](https://social.msdn.microsoft.com/Forums/vstudio/en-US/3c9aa0fa-c860-4a26-bde0-4ccf8a3793b3/use-processstart-to-start-an-application-without-administrator-privileges-on-windows-7?forum=vbgeneral&ppud=4). (tl;dr) – HABO Jan 05 '18 at 21:21
  • Thank you HABO, the clue I needed was indeed at the link you provided below. 200 lines of code more and my program works as I need it to - thanks again! – Rob Jan 05 '18 at 22:29

0 Answers0