New
#1
How to exclude libraries from custom right-click menu entries
I want to add a custom context menu entry to open an administrator command prompt when right-clicking a directory or directory background. I borrowed the registry modification code (shown below) from tenforums and works fine.
However, I found that the command prompt context menu is also added to library folders and backgrounds. It seems that command shell windows cannot be open in such a way for hardlinks like Libaries. Note that no registry information was entered for the HKCR\LibraryFolder\Background\Shell, HKCR\AllFileSystemObjects\Shell nor HKCR\Folder\Shell subkeys.
I would like to exclude Libraries and Library backgrounds from displaying the command prompt context menu and think I can do so using the AppliesTo string, but don't know how the proper syntax for values. If I simply add AppliesTo string with value "NOT Libraries" to HKCR\Directory\shell\CommandPrompt\shell\cmdadmin and/or Directory\Background\Background\shell\CommandPrompt\shell\cmdadmin subkeys, the right-click menu entries disappear for ALL folders and/or folder backgrounds.
Questions:
1. What is the proper format/syntax for the values of AppliesTo string to exclude the custom context menu entry from library folders and library backgrounds?
2. Does the AppliesTo string need to be added to either HKCR\Directory or HKCR\Directory\Background or both keys?
Thanks!
From: Add or Remove Command Prompt Open Here Context Menu in Windows 10
Code:[HKEY_CLASSES_ROOT\Directory\shell\CommandPrompt\shell\cmdadmin] @="Open here as administrator" "HasLUAShield"="" "Icon"="imageres.dll,-5324" [HKEY_CLASSES_ROOT\Directory\shell\CommandPrompt\shell\cmdadmin\command] @="cmd /c echo|set/p=\"%V\"|powershell -NoP -W 1 -NonI -NoL \"SaPs 'cmd' -Args '/c \"\"\"cd /d',$([char]34+$Input+[char]34),'^&^& start /b cmd.exe\"\"\"' -Verb RunAs\"" [HKEY_CLASSES_ROOT\Directory\Background\shell\CommandPrompt\shell\cmdadmin] @="Open here as administrator" "HasLUAShield"="" "Icon"="imageres.dll,-5324" [HKEY_CLASSES_ROOT\Directory\Background\shell\CommandPrompt\shell\cmdadmin\command] @="cmd /c echo|set/p=\"%V\"|powershell -NoP -W 1 -NonI -NoL \"SaPs 'cmd' -Args '/c \"\"\"cd /d',$([char]34+$Input+[char]34),'^&^& start /b cmd.exe\"\"\"' -Verb RunAs\""