Run process with admin rights

Hi Mohamed,

On Windows you’ll want to use runas:

runas /user:"your_computer_name\administrator_name" "C:\path\program.exe"

On Mac OS or Lunix you need sudo.

sudo -u admin_username program

Problem is you’ll need to enter a password, and particularly with the Windows version Microsoft went to great lengths to intentionally prevent it from being automated, so you will need to have someone present to deal with the UAC prompt.

A better way would be to run the install from a process that has admin rights before your test.

Hope this helps,

Dave.

1 Like