Technology in terms you understand. Sign up for the Confident Computing newsletter for weekly solutions to make your life easier. Click here and get The Ask Leo! Guide to Staying Safe on the Internet — FREE Edition as my thank you for subscribing!

How Do I Create a Shortcut that Bypasses UAC to a Program Needing Administrative Access?

Question: I have a program that writes some information to an area of Windows 7 that requires administrative rights. As such, every time I run it, I am pestered by UAC. I understand there is a workaround to this by creating an entry in the Windows Task Scheduler, setting it to run as Administrator, then creating a shortcut which will execute that task entry. This is a trusted program – I have absolutely no concerns that it is doing naughty things. Knowing that I can do a workaround and knowing how to do it are two different things. Any help would be appreciated.

I’ve experienced the same thing, and it can definitely be annoying.

I would prefer that software we run regularly not require administrative access every time. Unfortunately not all software is written that cleanly. In those cases a workaround might well be a pragmatic solution.

You are correct: the workaround uses the Task Scheduler in an interesting way.

Become a Patron of Ask Leo! and go ad-free!

Running as administrator

As I’ve written before, logging in as a user with administrative privileges doesn’t mean you’re actually running as an administrator.

All that it means is you’re allowed to do so.

If I want to run Windows Command Prompt as an administrator, I right-click the icon or menu entry that launches it, and click “Run as administrator”, or right-click the Windows 10 Start menu and click on Command Prompt (Admin).

Command Prompt (Admin)

Then I get the familiar UAC prompt:

UAC resulting from Command Prompt (Admin)

In other situations, programs attempt to do something that requires administrative access after they’ve been run normally. When that happens, the UAC prompt will appear automatically.

Either way, it’s an interruption, particularly if you trust the program and it happens every darned time you run it.

Create the Task Scheduler task

In Windows 10, click the Start menu and type “scheduler”. Click on Task Scheduler when it appears.

Task Scheduler in the Windows 10 Start menu

(In Windows 7, click the “Start” orb, All ProgramsAccessories, System Tools, Task Scheduler.)

In the resulting window, click Create Task….

Create Task

In the resulting screen, give the task a name; I’ve typed “Administrative Shortcut.” Make sure “Run with highest privileges” is checked — this is the “Run as administrator” option.

Create Task Dialog

Click the Actions tab and then the New… button.

Task Scheduled - Actions Tab

In the resulting dialog, enter the full path to the program you want to run. In this example, I’ve entered the full path to cmd.exe, the Windows Command Prompt. Click OK.

New Action

Click on the Conditions tab.

If checked, uncheck “Start the task only if the computer is on AC power”, which may be set by default. We want this to work even if our laptop is running on battery.

Click OK and close the Task Scheduler.

Conditions Tab

Create a shortcut to the task

Right-click an empty area of the desktop, click New, and click Shortcut.

New Shortcut

This will open the “create shortcut” wizard.

The “location of the item” in this example is:

C:\Windows\System32\schtasks.exe /run /tn "Administrative Shortcut"

Piece by piece, that’s:

  • C:\Windows\System32\schtasks.exe – the full path to the Task Scheduler
  • /run – indicates we’re asking Task Scheduler to run one of its tasks
  • /tn – short for “task name”, this tells Task Scheduler we’ll identify the task to be run by its name
  • “Administrative Shortcut” – the name we gave to the task earlier, in quotes.

Click Next to move on to the name selection dialog. Give it a name — I chose “My Admin Shortcut” in this example — and click Finish.

Naming your shortcut

Shortcut Icon

Double-click that icon, and the task will start: the program will run with administrative privileges, and the UAC prompt will not interrupt you.

There’s sometimes a catch

There’s one small possible catch: frequently the program will not come to the foreground as the current program when it starts.

This can be somewhat confusing, as we’re used to starting a program and being able to interact with it right away. When a program is started with this trick, you may need to click on it after it starts to be able to interact with it.

Do this

Subscribe to Confident Computing! Less frustration and more confidence, solutions, answers, and tips in your inbox every week.

I'll see you there!

Podcast audio

Play

11 comments on “How Do I Create a Shortcut that Bypasses UAC to a Program Needing Administrative Access?”

  1. Is there a way to use AutoHotkey for this?
    I’ve just started using it and thought it might help. I know this may be too techie for the OP but I’d like to know because I also have programs that keep asking for UAC.
    Thanks,

    No. UAC is architected that it cannot be accessed that way, specifically because if AutoHotKey could do it then so could malware.

    Leo
    24-Feb-2012
    Reply
  2. Thanks Leo. That makes perfect sense! I’ve been getting carried away with AutoHotkey after your recommendation and momentarily forgot about security!

    Reply
  3. If you install windows 7 with SP1, there is much improvement in UAC behaviour now it do not prompts you while running number of programmes like winamp, vlc media player, nero etcetra…

    Reply
  4. If u have a secure pc, Do as I do and turn UAC off. I have never used it from day 1. Never liked it and never will. If u have safe surfing habits and know what ur installing, you’ll never have a problem. (I never have to date) Do you’re research before installing programs, it only takes a few minutes to do so.

    Reply
  5. I subscribe to your newsletter. So why every time I click on a link, Do I get a pop-up asking me to subscribe? Very annoying.
    {email address removed}

    Reply
    • That pop-up places a cookie on your computer which instructs it not to pop up again for one month. If you clear cookies, the pop-up will happen the next time you go to Ask Leo! Unfortunately, the page can’t check if you are on the mailing list or not.

      Reply
  6. ok
    ive read a few of your articles and you skirt the issue im here to address
    i want to be THE admin peroid. not “admin capable”
    i want to log in and operate as this. not line-item add, a “run as admin” for every exe on my harddrive
    how do i BECOME THE admin?

    Reply
    • You can turn off UAC. I believe the net effect is that you’re granted administrative privileges without being asked whenever needed.

      If that doesn’t work you’ll need to unhide the normally hidden account actually called “Administrator” and login using that account instead. In an administrative command prompt enter:

      net user administrator /active:yes

      Reply
  7. Is this risky ? In other terms : can malware take advantage of that, even though the program you have authorised in this way is legitimate and clean ?

    Reply
    • Everything is risky. Life is risky. :-) But this doesn’t add significant risk in my opinion. Of course malware could take advantage of it — anything is possible — but it would have to be highly specifically targeted. I’m not aware of a single case of that happening.

      Reply

Leave a reply:

Before commenting please:

  • Read the article.
  • Comment on the article.
  • No personal information.
  • No spam.

Comments violating those rules will be removed. Comments that don't add value will be removed, including off-topic or content-free comments, or comments that look even a little bit like spam. All comments containing links and certain keywords will be moderated before publication.

I want comments to be valuable for everyone, including those who come later and take the time to read.