Windows Explorer: Context menu to a especific folder (background)

context menuwindowswindows-registry

(This is not a duplicate – I have checked before asking)

Both .reg commands add a custom item entry to a folder context menu:

1. Context menu to folders:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\shell\my custom command]
@="My command name"
"AppliesTo"="C:\\My specific Folder\\"

[HKEY_CLASSES_ROOT\Directory\shell\my custom command\command]
@="cmd.exe /s /k pushd \"%V\""

2. Context menu to folder background (empty area of a folder):

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\Background\shell\my custom command]
@="My command name"
"AppliesTo"="C:\\My specific Folder\\"

[HKEY_CLASSES_ROOT\Directory\Background\shell\my custom command\command]
@="cmd.exe /s /k pushd \"%V\""

The line "AppliesTo"="C:\\My specific Folder\\" set which specific folder the menu entry will appear.

The problem is in (2) it won't accept "AppliesTo"="C:\\My specific Folder\\". If I put that registry value ("AppliesTo") the menu entry won't appear at all.
How do I set a specific folder to (2)?

Best Answer

You need to use property names like:

AppliesTo = System.ItemName:"foo"
System.FileName
System.ItemFolderPathDisplay
System.ItemPathDisplay

There's a lot of these. Check out: https://freeswitch.org/stash/projects/FS/repos/freeswitch/browse/libs/portaudio/src/hostapi/wasapi/mingw-include/propkey.h?at=FS-3387_new_pa

Related Question