Create Elevated Shortcut without UAC prompt in Windows 10  

Page 12 of 20 FirstFirst ... 21011121314 ... LastLast
  1. Matthew Wai's Avatar
    Posts : 5,072
    Windows 10 Home 20H2
       #110

    Paul Black said:
    Thanks for the reply, it is appreciated!
    Are there not one liner commands that I can enter into the shortcut then?
    Another member, @Cirus, uses runas.exe /user:XXX\Administrator /savecred in a shortcut, which can bypass a UAC prompt. See this post: Add Create Restore Point Context Menu in Windows 10
    I have never used the command, so I don't know how/whether it works.
      My Computer

  2. Paul Black's Avatar
    Posts : 12,191
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
       #111

    Matthew Wai said:
    Another member, @Cirus, uses runas.exe /user:XXX\Administrator /savecred in a shortcut, which can bypass a UAC prompt. See this post: Add Create Restore Point Context Menu in Windows 10
    I have never used the command, so I don't know how/whether it works.
    Thanks, I will give that a try.

    I know that if the following is put into a REG file and run it works.

    I just wondered if any of them could be adapted for a shortcut! . . .
    Code:
    [HKEY_CLASSES_ROOT\Directory\shell\OpenCmdHereAsAdmin]
    @="CMD - Open Here As Administrator"
    "Extended"=-
    "Icon"="imageres.dll,-5324"
    
    [HKEY_CLASSES_ROOT\Directory\shell\OpenCmdHereAsAdmin\command]
    @="cmd /c echo|set/p=\"%L\"|powershell -NoP -W 1 -NonI -NoL \"SaPs 'cmd' -Args '/c \"\"\"cd /d',$([char]34+$Input+[char]34),'^&^& start /b cmd.exe\"\"\"' -Verb RunAs\""
    
    ; ------------------------------------------------------
    
    [HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCmdHereAsAdmin]
    @="CMD - Open Here As Administrator"
    "Extended"=-
    "Icon"="imageres.dll,-5324"
    
    [HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCmdHereAsAdmin\command]
    @="cmd /c echo|set/p=\"%V\"|powershell -NoP -W 1 -NonI -NoL \"SaPs 'cmd' -Args '/c \"\"\"cd /d',$([char]34+$Input+[char]34),'^&^& start /b cmd.exe\"\"\"' -Verb RunAs\""
    
    ; ------------------------------------------------------
    
    [HKEY_CLASSES_ROOT\Drive\shell\OpenCmdHereAsAdmin]
    @="CMD - Open Here As Administrator"
    "Extended"=-
    "Icon"="imageres.dll,-5324"
    
    [HKEY_CLASSES_ROOT\Drive\shell\OpenCmdHereAsAdmin\command]
    @="cmd /c echo|set/p=\"%L\"|powershell -NoP -W 1 -NonI -NoL \"SaPs 'cmd' -Args '/c \"\"\"cd /d',$([char]34+$Input+[char]34),'^&^& start /b cmd.exe\"\"\"' -Verb RunAs\""
    
    ; ------------------------------------------------------
    
    [HKEY_CLASSES_ROOT\LibraryFolder\background\shell\OpenCmdHereAsAdmin]
    @="CMD - Open Here As Administrator"
    "Extended"=-
    "Icon"="imageres.dll,-5324"
    
    [HKEY_CLASSES_ROOT\LibraryFolder\background\shell\OpenCmdHereAsAdmin\command]
    @="cmd /c echo|set/p=\"%V\"|powershell -NoP -W 1 -NonI -NoL \"SaPs 'cmd' -Args '/c \"\"\"cd /d',$([char]34+$Input+[char]34),'^&^& start /b cmd.exe\"\"\"' -Verb RunAs\""
    Thanks in advance.
      My Computer


  3. Posts : 2
    Win 10
       #112

    Nice! Worked a treat!
    Even managed to pin it to the task bar
      My Computer

  4. Brink's Avatar
    Posts : 56,332
    64-bit Windows 10 Pro for Workstations build 21359
    Thread Starter
       #113

    Matthew Wai said:
    Another member, @Cirus, uses runas.exe /user:XXX\Administrator /savecred in a shortcut, which can bypass a UAC prompt. See this post: Add Create Restore Point Context Menu in Windows 10
    I have never used the command, so I don't know how/whether it works.
    This is similar to option 2 below, but beware of the possible security risk of the credentials used for the command.

    Elevated Program Shortcut - Create for Standard User - Windows 7 Help Forums
      My Computers

  5. Paul Black's Avatar
    Posts : 12,191
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
       #114

    OK, I have changed a few things to make my life easier so this should be simpler to achieve.

    My user account has administrative rights, so what command do I use in the shortcuts for BOTH the cmd and PowerShell so they open as Administrator please?
      My Computer

  6. Matthew Wai's Avatar
    Posts : 5,072
    Windows 10 Home 20H2
       #115

    @Brink, I have combined the CMD script and VBScript in option one into a single batch script:
    Download "Create an elevated shortcut.bat"

    The following improvements have been made:
    1. No ZIP file and extraction are needed. Just double-click to run it.
    2. It will create an LNK shortcut showing the application's default icon.
    3. The shortcut can be customized as mentioned in option two.

    Can you upload the batch script in place of the existing ZIP file and use the following screenshot?
    Create Elevated Shortcut without UAC prompt in Windows 10-image-1.jpg

    Gaffer said:
    Even managed to pin it to the task bar
    The shortcut created by the above batch script can also be pinned to the taskbar. Try it out.

    Paul Black said:
    My user account has administrative rights, so what command do I use in the shortcuts for BOTH the cmd and PowerShell so they open as Administrator please?
    The simplest way is to use the above batch script. However, if you are willing take the following risk, I can try to create a different script.
    Brink said:
    beware of the possible security risk of the credentials used for the command.
      My Computer

  7. Brink's Avatar
    Posts : 56,332
    64-bit Windows 10 Pro for Workstations build 21359
    Thread Starter
       #116

    Thank you for the update @Matthew Wai.

    Option 1 in the tutorial has now been updated for this.
      My Computers

  8. Paul Black's Avatar
    Posts : 12,191
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
       #117

    I have sorted it out.

    As the user account has admin privileges, and the UAC is disabled, what I did was create two shortcuts, one for cmd and one for PowerShell. I entered %windir%\system32\cmd.exe /k and %windir%\System32\WindowsPowerShell\v1.0\powershell.exe respectfully and then set them to Run as Administrator through Properties and Advanced.
    Create Elevated Shortcut without UAC prompt in Windows 10-image.png
    Create Elevated Shortcut without UAC prompt in Windows 10-image.png

    The only strange thing is that the cmd doesn't have . . .
    Create Elevated Shortcut without UAC prompt in Windows 10-image.png

    . . . at the top. Not a problem though!
      My Computer

  9. Matthew Wai's Avatar
    Posts : 5,072
    Windows 10 Home 20H2
       #118

    Paul Black said:
    the UAC is disabled
    "UAC in Windows 10 is a necessary evil. Originally, UAC was created to protect Windows Operating systems from unauthorized changes. In particular, UAC protects against unauthorized changes from misconfigurations, installations, malware, and unapproved actions."
    Source: You Better Think Twice Before You Disable UAC Windows 10 - Security Boulevard
      My Computer

  10. phrab's Avatar
    Posts : 634
    windows 10 professional 64-bit, 1204
       #119

    Brink said:
    Thank you for the update @Matthew Wai.

    Option 1 in the tutorial has now been updated for this.
    I downloaded & tried to use the files in the tutorial. I have:
    Create_a_scheduled_task.vbs
    Create_an_elevated_shortcut.bat
    Create_an_elevated_shortcut.bat doesn't work, doesn't create anything, just flashesAlso, if Metapad.exe (a notepad alternative) is chosen, there's a message that Windows can't open this type of file.Same message if Notepad is chosen

    - - - Updated - - -

    Brink said:
    Thank you for the update @Matthew Wai.

    Option 1 in the tutorial has now been updated for this.
    I downloaded & tried to use the files in the tutorial. I have:
    Create_a_scheduled_task.vbs
    Create_an_elevated_shortcut.bat

    I tried to test Create_an_elevated_shortcut.bat by choosing it to open Notepad. Also, if Metapad.exe (a notepad alternative) is chosen, there's a message that Windows can't open this type of file, the same message I get when choosing Notepad.

    Should this happen?
      My Computer


 
Page 12 of 20 FirstFirst ... 21011121314 ... LastLast

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 19:16.
Find Us




Windows 10 Forums