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

Page 2 of 2 FirstFirst 12
  1. Try3's Avatar
    Posts : 8,362
    Windows 10 Home x64 Version 21H1 Build 19043.1052
       #10

    Out of curiosity, I have just run the reg file on my ver 1809 and it works i.e. a Run as Admin entry now appears when I right-click on a .ps1 file.

    I suggest you two identify whether the fault is in the running of that .reg file or in Windows behaviour. Do the following Registry entries now exist?
    Code:
    [HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\runas]
    "HasLUAShield"=""
    [HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\runas\command]
    @="powershell \"-Command\" \"if((Get-ExecutionPolicy ) -ne 'AllSigned') { Set-ExecutionPolicy -Scope Process Bypass }; & '%1'\""
    If not then the .reg file has not done its job.
    If the Registry entries do exist then Windows is not processing them correctly.

    Denis
      My Computer


  2. Posts : 2
    Window 10
       #11

    This doesn't seem to be working in Windows 10 1909

    Under [HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\ there is no
    Code:
    runas
    key at all, but there is a
    Code:
    PowerShellISEAsAdmin
    key with a
    Code:
    command
    sub-key.
      My Computer

  3. Try3's Avatar
    Posts : 8,362
    Windows 10 Home x64 Version 21H1 Build 19043.1052
       #12

    yannduran said:
    This doesn't seem to be working in Windows 10 1909

    Under [HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\ there is no
    Code:
    runas
    key at all, but there is a
    Code:
    PowerShellISEAsAdmin
    key with a
    Code:
    command
    sub-key.
    What you describe indicates that the .reg file has not been run or has not run correctly.
    Tutorial Step 2 - Add_PS1_Run_as_administrator.reg

    Denis
      My Computer

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

    yannduran said:
    This doesn't seem to be working in Windows 10 1909
    Hello yannduran, and welcome to Ten Forums.

    I have updated the .reg files in the tutorial to include restoring the default associations of .ps1 files so the context menu will work again now.

    You will just need to download and merge the new .reg file in the tutorial.
      My Computers


  5. Posts : 4
    Windows 10 Pro, Server 2016
       #14

    Great Customization as always


    Got on to Thank you Brink, your context menu items always work for me. I was wondering if you could make one to Run with Powershell 7 as Admin, and if it isn't to much trouble maybe a cascade menu option for all the powershell options, currently I have Run with Powershell, Run with Powershell as admin, Open with ISE, and Open with ISE as admin, combined with the Edit with Notepad as Admin and Edit with Notepad as Admin it is getting quite cluttered.

    Also, I know it would be a pain to go through the past ones, but it would really help if you would post the code as well as the file download link, especially for some of us that are on secure networks that frown on downloading executable files over the network.
      My Computer

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

    DrgnLrd said:
    Got on to Thank you Brink, your context menu items always work for me. I was wondering if you could make one to Run with Powershell 7 as Admin, and if it isn't to much trouble maybe a cascade menu option for all the powershell options, currently I have Run with Powershell, Run with Powershell as admin, Open with ISE, and Open with ISE as admin, combined with the Edit with Notepad as Admin and Edit with Notepad as Admin it is getting quite cluttered.

    Also, I know it would be a pain to go through the past ones, but it would really help if you would post the code as well as the file download link, especially for some of us that are on secure networks that frown on downloading executable files over the network.
    Hello, and welcome to Ten Forums.

    I've added the contents of the .reg file to this tutorial to help.

    I shall look into creating a cascade context menu with all these options for PS1 files, and will post back with a tutorial link when ready.
      My Computers

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


 
Page 2 of 2 FirstFirst 12

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 18:07.
Find Us




Windows 10 Forums