first thing first...
"appliesto" pretty much works for file types
so u can exclude small files like this:
"AppliesTo"="NOT System.Size:1..4kB"
this will skip context menu on files smaller than 4kB
so what u tryin to do with apllies to wont work
next...
your cmd command is probably wrong thats why it does not work with virtual folders
CMD.exe "%1" is not correct, "cmd.exe \"%V\"" would be correct alongside any other commands u want
next...
windows has this feature already to open CMD or Powershell in any folder/background/drive context menu which is what u tryin to replicate here
it gets activate if you hold shift key and then right click on folder or empty space inside folder, ull get two options there, open command window here/open powershell window here
if u dont want to hold shift key to get that "feature" in context menu
open regedit
HKCR\Drive\Shell\cmd
HKCR\Directory\Shell\cmd
HKCR\Directory\Background\Shell\cmd
HKCR\Drive\Shell\Powershell
HKCR\Directory\Shell\Powershell
HKCR\Directory\Background\Shell\Powershell
delete "Extended" in all these (thats teh shift key context menu) and it will appear in context menu without shift key
Thank you for your reply.
Just as a reference, I use registry modifications posted on tenforums.com
1. So the AppliesTo string only works with files and not directories or folder paths correct? When I add AppliesTo string to HKCR\Directory\shell and HKCR\Directory\Background\shell, without a value or with an incorrect syntax, the right-click option disappears for ALL folders, not just regular, non-library folders, just an FYI.
I am trying to adapt the AppliesTo string to a path as in this tenforums tutorial which adds "take ownership" to right-click menu. If you look at the registry file,
Add Take Ownership to Context Menu in Windows 10 | Tutorials (tenforums.com)
the author specifically keeps "take ownership" from showing up on critical drives like the c drive, program files, program data, using the following string and value:
"AppliesTo"="NOT (System.ItemPathDisplay:=\"C:\\Users\" OR System.ItemPathDisplay:=\"C:\\ProgramData\" OR System.ItemPathDisplay:=\"C:\\Windows\" OR System.ItemPathDisplay:=\"C:\\Windows\\System32\" OR System.ItemPathDisplay:=\"C:\\Program Files\" OR System.ItemPathDisplay:=\"C:\\Program Files (x86)\")
So using the System.ItemPathDisplay, would it not be possible to use NOT System.ItemPathDisplay variable with path to libray to omit the libraries?
2. I am using this command prompt registry modification here:
https://www.tenforums.com/tutorials...ompt-open-here-context-menu-windows-10-a.html
It adds both a regular and administrative command prompt in one flyout menu.
The registry value for the regular command prompt is
"cmd.exe /s /k pushd \"%V\""
and for the administrative prompt is
"cmd /c echo|set/p=\"%L\"|powershell -NoP -W 1 -NonI -NoL \"SaPs 'cmd' -Args '/c \"\"\"cd /d',$([char]34+$Input+[char]34),'^&^& start /b cmd.exe\"\"\"' -Verb RunAs\""
Are they not correct? They seem to work.
Your point about the command not being right led me to think of another idea. Rather than try to exclude libraries from an AppliesTo string, can the actual command value be modified to exclude libraries?
3. I usually hide the default powershell menu in windows and install PowerShell 7 and use those context menu entries. I also hide the default command prompt and use the registry modification posted at tenforums. I am familiar with the Extended string and it does hide hide the context menu options from regular view but I am trying to learn a little about the guts of the registry and would like a more elegant solution to the issue.
Thanks!