Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Tip to bypass UAC prompt w/ Task Scheduler AND focus the window

12 Jul 2012   #1
chillz

Windows 7 Ultimate x64
 
 
Tip to bypass UAC prompt w/ Task Scheduler AND focus the window

Just wanted to pass on this tip I found since it was hard to come by (only saw it in on one site).

Many of us know the trick about creating a shortcut with administrator privileges through the Task Scheduler to get around the UAC prompt. Elevated Program Shortcut without UAC Prompt - Create

But the annoying thing is when you open the program from this shortcut the window won't be focused and will open in the background if there are windows on top.


This trick will create the same admin level shortcut and focus the window as well.

Follow the tutorial as usual but when you get to the Actions tab, in the Program/script box enter:

C:\WINDOWS\System32\cmd.exe


In the Add arguments (optional) box enter:

/c start "TaskName" "Program Path"


For example: /c start "StartChrome" "C:\Program Files\Chrome\Chrome.exe"


This will open up cmd.exe and pass the arguments to it, because /c is specified it will run those arguments and then close. Since 'start' will give anything started with it focus, the program will come up with its window focused.

Do everything else in the tutorial the same and that's it. Hope this helps somebody else, because the unfocused window was really bugging me.


My System SpecsSystem Spec
.
18 Jul 2012   #2
Brink
Microsoft MVP

64-bit Windows 10 Pro
 
 

Thank you chillz. Steps 7 and 8 have been updated in the tutorial for this to help others.

Elevated Program Shortcut without UAC Prompt - Create
My System SpecsSystem Spec
Reply

 Tip to bypass UAC prompt w/ Task Scheduler AND focus the window




Thread Tools




Similar help and support threads
Thread Forum
System Restore using Task Scheduler - Bypass the 7 Day wait
I am trying to see if there is any way to enable System Restore through Task Scheduler to run every night and by pass the 7 day wait. I understand that there will only be a new system restore created if there have been none for 7 days. I have tons of disk space and would like to find a method...
Performance & Maintenance
Need help creating a task scheduler task to move files over a network.
Hello everyone, I need to have a task run that will move the contents of a folder from one computer to another over my home LAN. Files get downloaded during the night on one computer and then need to be transfered to another. Usually I am doing this by hand, but then though maybe I could get...
General Discussion
Task scheduler unable to load task status/active tasks at startup.
My task manager is unable to load task status/active tasks at startup. I get the message: "The selected task "{0}" no longer exists. To see the current tasks, click Refresh." When I refresh I get the same message. I checked and found that under Microsoft the problem was in the defrag...
Performance & Maintenance
Task Scheduler failing to start task with merged network locations
I have two routers I usually connect to (work and home) and each have wireless access. That means there are essentially 4 network locations I have listed. I have merged each respective network location (wired and wireless) into their own singular network location - "Work" and "Home". I also...
General Discussion
Console output window shown by task scheduler
Hello... I had a task (a php script) running periodically on Windows Vista to change my network routes automatically (because OSPF support have been dropped by MS) and it was working fine... Now I am trying to run the very same script on a Windows 7 system... It runs fine, but on every run it...
Performance & Maintenance


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 05:08.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App