How to Disable Default "Open with PowerShell" Right-Click Menu Entry

Page 3 of 3 FirstFirst 123

  1. Posts : 526
    Win7 Pro X64, Win10 Pro x640
    Thread Starter
       #21

    Disabling the context menu does indeed grey out the options from the File Menu as well. LegacyDisable and ProgrammaticAccessOnly disable both the context menu and file menu. I wonder if there is another keyword to disable just the context menu or, more likely, that another location in the registry needs to be modified to separate the context menu from file menu?

    Brink said:
    I wasn't aware of it also removing in from the File menu.

    Open PowerShell window here context menu - Add in Windows 10
    - - - Updated - - -

    Good afternoon @Brink

    I also discovered that if you remove the Share right-click menu, the ribbon command is also disabled.
    How to Add or Remove Share Context Menu in Windows 10

    So it stands to reason that some of the ribbon/menu bar commands and context menu entries are connected, right?

    Brink said:
    I wasn't aware of it also removing in from the File menu.

    Open PowerShell window here context menu - Add in Windows 10
      My Computer


  2. Posts : 70,978
    64-bit Windows 11 Pro for Workstations
       #22

    bamajon1974 said:
    Good afternoon @Brink

    I also discovered that if you remove the Share right-click menu, the ribbon command is also disabled.
    How to Add or Remove Share Context Menu in Windows 10

    So it stands to reason that some of the ribbon/menu bar commands and context menu entries are connected, right?
      My Computers


  3. Posts : 526
    Win7 Pro X64, Win10 Pro x640
    Thread Starter
       #23

    @Brink who is the member that is really good with scripting and registry modification, his name was keith or something similar? I would like to tag him as well to as his opinion.

    Brink said:
      My Computer


  4. Posts : 70,978
    64-bit Windows 11 Pro for Workstations
       #24

    bamajon1974 said:
    @Brink who is the member that is really good with scripting and registry modification, his name was keith or something similar? I would like to tag him as well to as his opinion.
    There's many, so one should see this soon hopefully.
      My Computers


  5. Posts : 7,194
    22H2 64 Bit Pro
       #25

    Maybe this has something to do with it?

    bamajon1974 said:
    @dalchina

    I don't have the PowerShellMenu key. I have a Powershell menu key that is the default. However, I modified the default key to add an icon string and change the MUIVerb string for a more consistent right-click menu. Nothing else was changed. I even left the Extended string to enable only on Shift+Right-Click.

    I can disable the context menu by adding a LegacyDisable or ProgrammaticAccessOnly string but the File Menu PowerShell menu entries are also disabled. There has to be another key (that I don't know) or a modification somewhere else in the registry to accomplish what I want.

    Alternatively, do you know how to disable the File Meny PowerShell entry and remove from view altogether?
    Maybe try to remove the icon string and restore the original MUIVerb. I don't know the details. If you set it back to how it was then reboot it might allow you to disable the context menu entry without affecting the file menu. (Just a guess).
      My Computer


  6. Posts : 526
    Win7 Pro X64, Win10 Pro x640
    Thread Starter
       #26

    Does anyone have any ideas? I looked at the PowerShell entries for the Windows Command Store under [HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell} registry key. For example, "Windows.location.Powershell" and "Windows.location.PowershellAsAdmin" keys have "CommandStateSync", "ExplorerCommandHandler", and "ImpliedSelectionModel" strings/dwords but I am not sure what they do. Can anyone that is really familiar with the registry please chime in? Thanks!
      My Computer


  7. Posts : 12
    Windows 10 22H2
       #27

    The only circumstance I can find in which the powershell context menu option works, but the File menu option is greyed out is if the selection is a virtual (namespace) folder, such as Documents or Downloads. These virtual Folders have their own Folder entry in HKCR, which doesn't include Powershell options, so I'm interested to note that the context menu options work.

    Hiding static context menu options using ProgrammaticAccessOnly shouldn't affect other usage of the verb you've hidden - that is the point of the option.

    Your reference to disabling the share context menu isn't relevant. This is a shell extension (found under the shellex key), and some methods of disabling it such as blocking the extension should certainly remove it (or break it) everywhere.

    Mike
      My Computer


  8. Posts : 526
    Win7 Pro X64, Win10 Pro x640
    Thread Starter
       #28

    skeptic mike said:
    The only circumstance I can find in which the powershell context menu option works, but the File menu option is greyed out is if the selection is a virtual (namespace) folder, such as Documents or Downloads. These virtual Folders have their own Folder entry in HKCR, which doesn't include Powershell options, so I'm interested to note that the context menu options work.

    Hiding static context menu options using ProgrammaticAccessOnly shouldn't affect other usage of the verb you've hidden - that is the point of the option.

    Your reference to disabling the share context menu isn't relevant. This is a shell extension (found under the shellex key), and some methods of disabling it such as blocking the extension should certainly remove it (or break it) everywhere.

    Mike
    I have been modifying HKLM keys, not HKCR. Should I try modifying the latter?
      My Computer


  9. Posts : 12
    Windows 10 22H2
       #29

    bamajon1974 said:
    I have been modifying HKLM keys, not HKCR. Should I try modifying the latter?
    It probably won't make any difference. HKCR is a virtual key. It is HKLM\Software\Classes overlaid with HKCU\Software\Classes.

    Explorer will read HKCR, so it is possible to modify HKCR by changing HKCU\Software\Classes, but because you can only add keys and values, you can overwrite a value, but you can't delete one.

    So, check HKCR to be clear about what Explorer will see. You can open more than one regedit window using the /m command line option. So, you can have open windows for each actual location, and the virtual combination. If you change anything in one, you must refresh (F5) the views in the others, as regedit doen't watch for changes. In general, if I am making changes like this, I make the changes in HKCU. This generally involves creating the appropriate keys, as they often don't exist.

    To add to the strangeness, once you've made the appropriate key in HKCU, you can then edit or add the values in HKCR, and they will be saved in HKCU. My normal account doesn't have admin rights, so that's what I normally do for anything that looks like a personal preference such as this. It also saves you the trouble of messing with permissions for features such as this where TrustedInstaller is the owner, and administrators only have read permissions.

    If you are still finding that the File option is greyed out when you look at real directories, then I'm mystified as to what's happening. One possible check that you could make is to look at another account on your PC. If you don't have one without admin rights, it's worth making one, so you can experiment at the user level without risking a mess for other accounts. You can easily delete the profile of this account and start again.

    Mike
      My Computer


 

  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 20:28.
Find Us




Windows 10 Forums