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

Page 1 of 3 123 LastLast

  1. Posts : 521
    Win7 Pro X64, Win10 Pro x640
       #1

    Disable Default "Open Windows PowerShell" Right-Click Menu?


    (Edited)
    How to Disable Default "Open with PowerShell" Right-Click Menu Entry-image.png

    How would one permanently disable Shift+Right-Click "Open PowerShell window here" context menu without simultaneously disabling the PowerShell and Elevated PowerShell Options in the File Explorer File Menu Bar?

    More info: For Registry Keys [HKLM\Software\Classes\Directory\shell\PowerShell], [HKLM\Software\Classes\DirectoryBackground\shell\PowerShell], and [HKLM\Software\Classes\Drive\shell\PowerShell] keys, the default Shift+Right-Click "Open with PowerShell window here" context menu can be disabled by adding "LegacyDisable" or "ProgrammaticAccessOnly" strings. Doing so, however, also disables (greys out) the PowerShell and Admin PowerShell Options in Explorer File Menu bar.

    What would be the correct string or dword or any registry modification to disable the shift+right-click menu without disabling the Explorer File Menu bar options?

    Would the keys above be the correct ones to modify? Perhaps a CLSID key or a key from the window command store?
    [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell]?

    @KeithM, any ideas here?

    Thanks!
    Last edited by bamajon1974; 02 Aug 2023 at 19:48.
      My Computer


  2. Posts : 43,007
    Win 10 Pro (22H2) (2nd PC is 22H2)
       #2

    Hi, not sure that's a default option...

    The registry information in this tutorial (from the huge searchable Tutorials section - do have a look) hopefully contains enough to let you do that:
    Open PowerShell window here context menu - Add in Windows 10

    I only want to disable the context menu entry to reduce clutter.
    Note there's also a SHIFT option given there (i.e. only shown on SHIFT rt click) - which I note is what I happen to have for folders.
      My Computers


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

    Good afternoon @dalchina . You are correct. Those are not the default option. I added an Admin PowerShell Window entry, as well as added an icon, to the default standard privilege PS option, to the right-click menu for directories, directory backgrounds, and drives.

    However, now that I have Windows Terminal, there is no need for the PS entries. I can easily remove my added entries. But the default PS entry remains. When deleting the key, or disabling, also grays out the PS entries in the Explorer file menu.

    Does this make sense?
      My Computer


  4. Posts : 6,854
    22H2 64 Bit Pro
       #4

    I don't think that it's default either. Have you got a subkey key "powershellmenu" here?

    Computer\HKEY_CLASSES_ROOT\Directory\shell

    If so review this article:

    How to Add or Remove "Open PowerShell Here" to context menu - Developing Daily
      My Computer


  5. Posts : 43,007
    Win 10 Pro (22H2) (2nd PC is 22H2)
       #5
      My Computers


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

    @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?

    Thanks!

    Callender said:
    I don't think that it's default either. Have you got a subkey key "powershellmenu" here?

    Computer\HKEY_CLASSES_ROOT\Directory\shell

    If so review this article:

    How to Add or Remove "Open PowerShell Here" to context menu - Developing Daily
      My Computer


  7. Posts : 43,007
    Win 10 Pro (22H2) (2nd PC is 22H2)
       #7

    Ah- you mean you're only concerned about the options from File, top left of file explorer...

    I don't think that can be removed... and it's greyed out unless something to which it can apply is selected in file explorer.

    That said- if you were to remove Powershell...
      My Computers


  8. Posts : 6,854
    22H2 64 Bit Pro
       #8

    Here's what I have in terms of subkeys.

    How to Disable Default "Open with PowerShell" Right-Click Menu Entry-registry-editor.jpg
      My Computer


  9. Posts : 6,854
    22H2 64 Bit Pro
       #9

    So I have default entries and I've added:

    How to Disable Default "Open with PowerShell" Right-Click Menu Entry-context-menu.jpg

    I still have:

    How to Disable Default "Open with PowerShell" Right-Click Menu Entry-file-menu.jpg

    I'm pretty sure that "Open Windows Powershell" isn't a default context menu entry.

    Does anyone else have it as default?
      My Computer


  10. Posts : 6,854
    22H2 64 Bit Pro
       #10

    You might want to change the thread title from:

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

    to:

    How to Disable Default "Open Windows PowerShell" Right-Click Menu Entry
      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 12:27.
Find Us




Windows 10 Forums