New
#180
Go to Task Scheduler. Expand "Task Scheduler Library". Click on "Apps". Delete the task "Create_an_elevated_shortcut" and run the script again. Also, as the context menu is at issue, it would have been better to post the problem in the following tutorial:
How to Add Create Elevated Shortcut to New Context Menu in Windows 10
BTW, if you are interested, consider Using CMD script and VBScript to control Windows Update
You are most welcome!
BIg thank-you to Shawn and Mathew for keeping this alive and lively. It’s still incredibly useful … not only for its stated purpose but also for running utilities/apps that need to run both elevated and in Win 7/Win XP Compatibility mode.
I‘ve recently (3 Oct ‘20) completed the Win7 --> Win10 migration and none of the shortcuts created following Brink’s SevenForum tutorial (Option 2 here) worked. The reason was that I had prefaced my Task Scheduler tasks with ! (!HiCMD, !Reflect, etc.). It worked fine in Win 7 but not Win 10; Mathew alludes to this in the instructions for his scripted approach which is what gave me the needed clue. The following is offered in the hope it will be useful to somebody else.
Unfortunately it is not possible to simply modify the task name (at least I was unable to edit that field) so new tasks are required. I have 7 of these shortcuts and it only took about 5 mins. The process used was
- Export existing tasks (to retain commands/arguments)
- Create a new task (I used Option 2 but I believe either Option will work)
- Export it
- Edit it (in text editor) replacing the <Exec> block with that of an old exported task:
- Save As your new task name & import into Task Scheduler
- Right click on the associated Shortcut and update the Target task name:
BTW if “Run Minimized” doesn’t eliminate the flashing cmd window – which I’ve had happen – another way to stop seeing the flash is to click on the Shortcut’s Layout tab and set Window Size/Location parameters to 1 (it won’t accept zero) making sure “Let system position window” is unchecked.
Very, very helpful tutorial . . . thank you! Noticed something today. I have a calendar (Rainlendar) located at the top right of my laptops screen. If I create a desktop shortcut using the bat file method (Option One), the calendar shows through the apps window until I click on the window to bring it to the forefront. If I create the shortcut by manually (Option Two) creating the task in Task Scheduler it seems that the app window is brought to the forefront automatically just like any other launched app.
Certainly not a big issue, just wondering.
Please run the modified version below and see whether the problem has been fixed.
Create_an_elevated_shortcut.bat
Remember to delete the old scheduled task beforehand.