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).
Then I get the familiar UAC prompt:
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.
(In Windows 7, click the “Start” orb, All Programs, Accessories, System Tools, Task Scheduler.)
In the resulting window, click 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.
Click the Actions tab and then the New… button.
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.
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.
Create a shortcut to the task
Right-click an empty area of the desktop, click New, and click 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.
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.
If you found this article helpful, I'm sure you'll also love Confident Computing! My weekly email newsletter is full of articles that help you solve problems, stay safe, and give you more confidence with technology. Subscribe now and I'll see you there soon,