Run as administrator - Add to PS1 File Context Menu in Windows 10  

Page 1 of 2 12 LastLast
    Run as administrator - Add to PS1 File Context Menu in Windows 10

    Run as administrator - Add to PS1 File Context Menu in Windows 10

    How to Add 'Run as administrator' to PS1 File Context Menu in Windows 10
    Published by Category: Customization
    08 May 2021
    Designer Media Ltd


    How to Add 'Run as administrator' to PS1 File Context Menu in Windows 10


    Some legitimate applications require a full administrator access token (elevated) to perform their functions or tasks. For example, when a program that you are trying to run is giving you a Access Denied or No Permission type error.

    When you right click on application files, you can use the Run as administrator context menu item to run the app with elevated rights (full administrator access token).

    This tutorial will show you how to add or remove Run as administrator from the context menu of PowerShell .ps1 files for all users in Windows 10.

    You must be signed in as an administrator to be able to add or remove this context menu.




    EXAMPLE: "Run as administrator" in context menu of PS1 files
    Run as administrator - Add to PS1 File Context Menu in Windows 10-ps1_run_as_administrator.png



    Here's How:

    1 Do step 2 (add) or step 3 (remove) below for what you would like to do.


    2 To Add "Run as administrator" to PS1 file Context Menu

    The .reg file in this step also includes the contents of the ps1.reg file here to restore the default associations for .ps1.

    A) Click/tap on the Download button below to download the file below, and go to step 4 below.

    Add_PS1_Run_as_administrator.reg

    Download


    3 To Remove "Run as administrator" from PS1 file Context Menu

    This is the default setting.

    A) Click/tap on the Download button below to download the file below, and go to step 4 below.

    Remove_PS1_Run_as_administrator.reg

    Download


    4 Save the .reg file to your desktop.

    5 Double click/tap on the downloaded .reg file to merge it.

    6 When prompted, click/tap on Run, Yes (UAC), Yes, and OK to approve the merge.

    7 You can now delete the downloaded .reg file if you like.


    That's it,
    Shawn Brink




  1. Posts : 3
    10
       #1

    First off, thank you! This is one of the best reg edits!

    I was trying to convert this.reg to use in a .bat using http://www.sordum.org/8478/reg-converter-v1-0/

    But it doesn't quite work. any tips for getting this to work in a .bat?

    again thank you!
      My Computer

  2. Brink's Avatar
    Posts : 57,699
    64-bit Windows 10 Pro for Workstations build 21390
    Thread Starter
       #2

    Hello treeman, :)

    Yeah, the PowerShell wrapper in it would put a damper on that.
      My Computers


  3. Posts : 4
    Windows 10
       #3

    Awesome reg file. Could you possibly make a context menu to Edit with PowerShell ISE as Admin?
    I found this, but I can't seem to get it to work Adding to the context menu | Tech thoughts
      My Computer

  4. Brink's Avatar
    Posts : 57,699
    64-bit Windows 10 Pro for Workstations build 21390
    Thread Starter
       #4

    Hello @michaeljt, and welcome to Ten Forums.

    I'll be happy to take a look to see what I may be able to come up with.

    For now, you could use "Open with" > "Choose another app" for this. You can select to "Open with" the %windir%\system32\WindowsPowerShell\v1.0\PowerShell_ISE.exe file with the "Always use this app" box unchecked.

    This way "Windows PowerShell ISE" will be added to the "Open with" context menu of the file type (ex: ".ps1") like below.

    It's not run as admin though.

    Run as administrator - Add to PS1 File Context Menu in Windows 10-open_with.jpg
      My Computers


  5. Posts : 4
    Windows 10
       #5

    Hello Brink and thank you. If you do ever find a way for Edit as Administrator that would be great.
      My Computer

  6. Brink's Avatar
    Posts : 57,699
    64-bit Windows 10 Pro for Workstations build 21390
    Thread Starter
       #6
      My Computers


  7. Posts : 61
    windows 10
       #7

    I launch the reg file and got the... "Add_PS1_Run_as_administrator.reg have been successfully added to the registry."

    but it doesnt add anything to the context menu
      My Computer

  8. Brink's Avatar
    Posts : 57,699
    64-bit Windows 10 Pro for Workstations build 21390
    Thread Starter
       #8

    chok said:
    I launch the reg file and got the... "Add_PS1_Run_as_administrator.reg have been successfully added to the registry."

    but it doesnt add anything to the context menu

    Hello chok,

    Just to verify, are you right clicking on a .ps1 file?
      My Computers


  9. Posts : 32
    windows 10
       #9

    I confirm it does not work on windows 1809. there is no menu entry for ps1 on the right click.
      My Computer


 
Page 1 of 2 12 LastLast

Tutorial Categories

Run as administrator - Add to PS1 File Context Menu 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 16:54.
Find Us




Windows 10 Forums