Create Elevated Shortcut without UAC prompt in Windows 10  

Page 10 of 25 FirstFirst ... 8910111220 ... LastLast

  1. Posts : 68,891
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #90

    Matthew Wai said:
    @Brink,
    I have written CMD and VBScript files that can automatically create an elevated app shortcut with no UAC prompt. They apply to built-in apps such as Command Prompt, PowerShell, and Registry Editor as well as third-party apps such as WAU Manager. Users just have to take three steps:

    1. Double-click on the script file "Create an elevated shortcut.cmd".
    2. Enter the application's name, to be used as the task name and shortcut name.
    3. Enter the application's full path.

    Then, the scripts will create a scheduled task with highest privileges and a CMD file, used as a shortcut, on the desktop. The scripts are in this attached file: Create_an_elevated_shortcut.zip. Would you consider including it in this tutorial?

    PS A small problem in my deleted post has been fixed in this post.
    Thank you Matthew.

    This has now been added as option 1 in the tutorial.
      My Computers


  2. Posts : 7,606
    Windows 10 Home 20H2
       #91

    @Brink, there are two problems:

    1. Did you intentionally or mistakenly disable the commands to automatically get administrative privileges?

    2. The following error is not very likely but not impossible.
    Now you have a task named "Command Prompt" in Task Scheduler. If you enter the same name via my script, the following message will appear repeatedly.
    ERROR: Cannot create a file when that file already exists.

    The solution is to close the following window and try again with a different name.
    Create Elevated Shortcut without UAC prompt in Windows 10-errors.jpg
      My Computer


  3. Posts : 68,891
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #92

    Matthew Wai said:
    @Brink, there are two problems:

    1. Did you intentionally or mistakenly disable the commands to automatically get administrative privileges?

    2. The following error is not very likely but not impossible.
    Now you have a task named "Command Prompt" in Task Scheduler. If you enter the same name via my script, the following message will appear repeatedly.
    ERROR: Cannot create a file when that file already exists.

    The solution is to close the following window and try again with a different name.
    There may have been an issue translating the Chinese language in the script to English. Please check the translated version I posted.
      My Computers


  4. Posts : 7,606
    Windows 10 Home 20H2
       #93

    Brink said:
    There may have been an issue translating the Chinese language in the script to English. Please check the translated version I posted.
    Don't use your translated version. Please use my translated version: Create_an_elevated_shortcut.zip
    The error in your version has been corrected, so you don't have to do step 5: right-click on the file and select "Run as administrator". Simply double-click on the file, which will automatically get administrative privileges.
    In the new version, some commands have been improved, so you will see the following simple screen, which can be used instead of your screenshots, one of which shows an error message at the top.
    Create Elevated Shortcut without UAC prompt in Windows 10-success.jpg
      My Computer


  5. Posts : 68,891
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #94

    Matthew Wai said:
    Don't use your translated version. Please use my translated version: Create_an_elevated_shortcut.zip
    The error in your version has been corrected, so you don't have to do step 5: right-click on the file and select "Run as administrator". Simply double-click on the file, which will automatically get administrative privileges.
    In the new version, some commands have been improved, so you will see the following simple screen, which can be used instead of your screenshots, one of which shows an error message at the top.
    Now updated.

      My Computers


  6. Posts : 16,932
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #95

    Matthew,

    The cmd file contains the false assumption that the user's desktop is at %USERPROFILE%\Desktop. Mine, for example, has been relocated to D:\Desktop and so it cannot be found & your script fails to create the elevated shortcut.
    - %USERPROFILE%\Desktop cannot cope with relocations,
    - %USERPROFILE%\Desktop merely gets resolved into C:\Users\%UserName%\Desktop
    Create Elevated Shortcut without UAC prompt in Windows 10-mw-error-msg.png

    See My batch code to find user desktop location - TenForums post for code that will find the Desktop even if it has been relocated.

    {The Task works though. I could run it manually then test it with cmds - whoami and reg query "HKU\S-1-5-19" {which would have returned Error: Access is denied if the cmd window had only had standard privileges.}

    Denis
      My Computer


  7. Posts : 7,606
    Windows 10 Home 20H2
       #96

    Try3 said:
    See My batch code to find user desktop location - TenForums post for code that will find the Desktop even if it has been relocated.
    Your code has been added into this third version: Create_an_elevated_shortcut.zip
    Please check whether it works with your relocated desktop.
      My Computer


  8. Posts : 16,932
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #97

    Matthew,

    Yes, the cmd batch file works. The vbs also works.

    [I have read the vbs through but I cannot see where it is referencing the desktop - yet it correctly creates the output file there. What am I missing?]

    Denis
      My Computer


  9. Posts : 7,606
    Windows 10 Home 20H2
       #98

    @Brink,
    Could you use this updated version "Create_an_elevated_shortcut.zip" in your tutorial? It now works with both the default desktop and a relocated desktop.

    Try3 said:
    [I have read the vbs through but I cannot see where it is referencing the desktop - yet it correctly creates the output file there. What am I missing?]
    You have missed the file name "Create an elevated shortcut.cmd", which means the shortcut is created by CMD. I have added your name into the CMD script. I'm afraid that the following VBScript command does not apply to a relocated desktop.
    CreateObject("Wscript.Shell").SpecialFolders("Desktop")
      My Computer


  10. Posts : 16,932
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #99

    Matthew,

    Yes, my vbs appreciation is clearly waning & it took another read through them both to realise that the vbs & the cmd file work in tandem [I had assumed, beforehand, that they were independent tools doing the same job as each other].
    By the way, in VBS, SpecialFolders("Desktop") does correctly identify my relocated Desktop.

    Denis
      My Computer


 

Tutorial Categories

Create Elevated Shortcut without UAC prompt in Windows 10 Tutorial Index Network & Sharing Instalation and Upgrade Browsers and Email General Tips Gaming Customization Apps and Features Virtualization BSOD System Security User Accounts Hardware and Drivers Updates and Activation Backup and Restore Performance and Maintenance Mixed Reality Phone


  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 13:41.
Find Us




Windows 10 Forums