Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
run.it -- as a non-privileged user?
#1
Is there a way to execute a run.it and make sure it doesn't execute with uac privileged status?  Of course, any time something is run directly from the editor, it'll run as an admin.  If I make an executable that can be run as a standard user, that's fine... but certain things I do, the applications I'm manipulating run as admin so the script needs to run as admin.  In those cases, there are times I'd like to have the script open up a webpage in the default browser for example.  In the case of a browser, I definitely do NOT want it to launch as admin.  

Currently as a workaround, I'm checking uacInfo.isAdmin.  If that's true, then I copy the URL I would open to the clipboard and pop up a dialog telling the user to paste that URL in the browser.  I just hoped there may be a fancy way to make it easier for my end users.

I suppose the challenge will be... what user can it be run as... because I'm not sure there's a programmatic way to see how the user is logged in if the parent process is started as admin.

Thanks.
#2
run.it always starts new process as not-admin. And there is flag to start as admin.

All other similar functions would start new process as admin if current process is admin. Including run.console, Process.Start, ShellExecute[Ex], CreateProcess.

Code:
Copy      Help
// script ""
print.it(uacInfo.isAdmin); //admin
run.it(folders.System + @"notepad.exe"); //not admin
run.it(folders.System + @"notepad.exe", flags: RFlags.InheritAdmin); //admin
Process.Start(folders.System + @"notepad.exe"); //admin
#3
Awesome!  Thank you.  I missed that Smile
#4
Currently it is only in RFlags documentation.


Forum Jump:


Users browsing this thread: 1 Guest(s)