question

JonathanWoodward-2815 avatar image
0 Votes"
JonathanWoodward-2815 asked JonathanWoodward-2815 answered

How to exclude libraries from "Open with Powershell window" context menu

The default "Open with Powershell window here" context menu entries in Win10 that appear when right-clicking a directory or directory background also appear when right-clicking the main library folder as well as specific library folders (documents, music, etc.) in the explorer navigation pane but the shell windows don't work, i.e. you cannot open a powershell window in a library.

Windows by default installs right-click context menu entries to launch a PowerShell window when right clicking a directory or directory background. The entries are installed in HKCU\Directory\shell and HKCU\Directory\Background\Shell. These entries work fine....meaning that when selecting Open PowerShell window upon right-clicking a directory, directory background or drive, a PowerShell window opens up to the desired directory.

However, these context menu entries are also present for Libraries, meaning that Open PowerShell Window Here exists for Libraries, but no shell can be opened for virtual folders and hardlinks. So PowerShell entries are not installed at HKCU\Library\Background\Shell, but, when right clicking the main library icon in File Explorer Navigation Pane, or the background of the main library virtual folder, a PowerShell context menu entry appears. When PowerShell is launched from the entry in a library, nothing happens. Note that, the PowerShell right-click entries for individual libraries, such as documents or pictures, have no PowerShell entries unless added to HKCR\Library\Background\shell

So, I would like to either: modify the context menu commands for PowerShell to open in libraries (which I don't think is possible for virtual folders) or exclude libraries, but not regular folders, from the registry entries.

How do I do this?

windows-10-general
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I am trying to involve someone familiar with this topic to further look at this issue. There might be some time delay. Appreciate your patience.
Thank you for your understanding and support.

0 Votes 0 ·

Please keep me posted.

If you know of a better place to post this question, please advise.

Thanks!

0 Votes 0 ·

Can I please get an answer? Why no response?

0 Votes 0 ·
JonathanWoodward-2815 avatar image
0 Votes"
JonathanWoodward-2815 answered

I never found a solution. MS by default adds either shift+right click "Open With Command Prompt here" or "Open with PowerShell Window here" to the main libraries icon in the navigation pane of explorer as well as the main libraries background explorer. Launching the shells in these locations does nothing, i.e. no command or powershell window opens. I don't think there is a solution.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

MotoX80 avatar image
0 Votes"
MotoX80 answered MotoX80 edited

Can I please get an answer? Why no response?

I'll guess that you didn't get a response because other users are not seeing the same problem.

My laptop was upgraded to win10 from win8 so that's not really a clean install. But I do have a clean install of a Win10 Pro VM that I use to play with stuff that I don't want to "corrupt" my main laptop with.

If if right click on the white space in a directory, this is the menu I get.

109532-capture.jpg



If I right click on a .txt file, this is the menu that I get.


109440-capture1.jpg


If I right click on a .ps1 file, this is the menu that I get. I have "Run with Powershell", but I do not have "Open with Powershell window here".



109450-capture2.jpg


Based on this link, it might depend on what version of Win10 that you start with.

https://www.tenforums.com/tutorials/60175-open-powershell-window-here-context-menu-add-windows-10-a.html.


Try the "23 To Remove 'Open PowerShell window here' Context Menu instructions."


Update: maybe try some of the free context menu editors.

https://www.thewindowsclub.com/remove-click-context-menu-items-editors


capture.jpg (81.5 KiB)
capture1.jpg (83.1 KiB)
capture2.jpg (76.8 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

JonathanWoodward-2815 avatar image
0 Votes"
JonathanWoodward-2815 answered

Can I please get an answer?

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.