0

I am trying to execute

runas /netonly /user:domain\username "C:\Users\user\Documents\Visual Studio 2015\Projects\samplePACE\samplePACE\bin\Debug\samplePACE.exe brown"

samplePACE.exe is the Application name and brown is the argument.

It will ask for a password. I have to enter and then the application gets executed.

I need to perform the above two operations using C#.

Thanks.

RBK
  • 558
  • 5
  • 16
  • Your questions is unclear...can you give us some code that you started off with ? maybe see if this will help you: https://stackoverflow.com/questions/3268022/process-start-arguments – Pieter Alberts May 11 '18 at 05:13

1 Answers1

0

You want to use use the Process class to run the process. Scroll to the bottom of that page for an example on how it is used.

To elevate (aka run as Administrator), you will need to use the 'runas' verb. See this SO post for more info: Elevating process privilege programmatically?

Ryan S
  • 521
  • 2
  • 6