DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: Shortcut to launch with admin privileges?  (Read 12,662 times)

kli6891

  • Honorary Member
  • Joined in 2009
  • **
  • Posts: 36
Shortcut to launch with admin privileges?
« on: November 16, 2009, 04:14 AM »
In start menu search, there is a handy ctrl+shift+enter to launch the selected program with admin. rights. Is there such a shortcut in FARR?


Thanks.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
Re: Shortcut to launch with admin privileges?
« Reply #1 on: November 16, 2009, 04:22 AM »
I had no idea about that shortcut, but it's a great idea to add it to farr. i will make it so that if you hold ctrl+shift when you trigger a result it will launch it with admin privileges. adding to todo list.

f0dder

  • [Well, THAT escalated quickly!]
  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
    • Participated in NANY Challenge Once
Re: Shortcut to launch with admin privileges?
« Reply #2 on: November 16, 2009, 07:08 AM »
tip: ShellExecute using the "RunAs" verb. Not properly documented and feels hacky, but that's the UAC API for you, I guess :(
- carpe noctem

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
Re: Shortcut to launch with admin privileges?
« Reply #3 on: November 20, 2009, 04:55 PM »
Done, implemented in v 2.80.01; hold ctrl+shift when triggering an item to run as admin; for alias results you can also indicate a result should be run as admin with /runasadmin option.

ps. thanks for the tip f0dder.  :up:

Stoic Joker

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 6,652
    • Cody Award
    • Participated in NANY Challenge Five Times
Re: Shortcut to launch with admin privileges?
« Reply #4 on: November 20, 2009, 07:32 PM »
tip: ShellExecute using the "RunAs" verb. Not properly documented and feels hacky, but that's the UAC API for you, I guess :(
As I recall, RunAs (in Shell & ShellExecute) was an option back in Win2k, it just never caught on because everybody just ran as Admin back then.

f0dder

  • [Well, THAT escalated quickly!]
  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
    • Participated in NANY Challenge Once
Re: Shortcut to launch with admin privileges?
« Reply #5 on: November 20, 2009, 11:46 PM »
tip: ShellExecute using the "RunAs" verb. Not properly documented and feels hacky, but that's the UAC API for you, I guess :(
As I recall, RunAs (in Shell & ShellExecute) was an option back in Win2k, it just never caught on because everybody just ran as Admin back then.
It was?

Thing is, the undocumented "RunAs" UAC thing in ShellExecute doesn't take any user credentials - so imho it's extremely misnamed.
- carpe noctem

putnum

  • Participant
  • Joined in 2010
  • *
  • Posts: 68
Re: Shortcut to launch with admin privileges?
« Reply #6 on: April 13, 2010, 02:45 PM »
Hi is there a way to pass the username and password to the /runsasadmin switch automatically?

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
Re: Shortcut to launch with admin privileges?
« Reply #7 on: April 13, 2010, 09:26 PM »
there is no way currently, but it's an interesting idea.

Stoic Joker

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 6,652
    • Cody Award
    • Participated in NANY Challenge Five Times
Re: Shortcut to launch with admin privileges?
« Reply #8 on: April 14, 2010, 12:45 AM »
Well... While I was beating the web bushes for a bit more elegant solution to the SetSystemTime debacle (hehe) I ran across this tutorial series that looks to be right about what you're after (Replete with Code Samples):

Asking the User for Credentials

anabus

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 1
Re: Shortcut to launch with admin privileges?
« Reply #9 on: May 14, 2010, 04:51 PM »
Done, implemented in v 2.80.01; hold ctrl+shift when triggering an item to run as admin; for alias results you can also indicate a result should be run as admin with /runasadmin option.

ps. thanks for the tip f0dder.  :up:

This seems to work when triggering an item using Ctrl+Shift+Enter, but it doesn't seem to work for Ctrl+Shift+Numpad #. Is this not how it's implemented (and I'm just doing it wrong), or is it supposed to work?

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
Re: Shortcut to launch with admin privileges?
« Reply #10 on: May 14, 2010, 09:35 PM »
thanks for the report -- i'll check -- sounds like i just forgot to handle that case.

Original address: https://www.donationcoder.com/forum/index.php?topic=20628.0