To add a sub menu you will need first to add the menu name like:
[HKEY_CLASSES_ROOT\Directory\shell\Notepad]
"SubCommands"="command1;command2;"
"MUIVerb"="Notepads"
"Position"="-"
The sub commands are the the trick.
each command is actually a reference to another registry entry.
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\command1]
@="command1"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\command1\command]
@="C:\\Windows\\System32\\cmd.exe"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\command2]
@="command2"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\command2\command]
@="C:\\Windows\\System32\\cmd.exe \K cd %1"
This will give you a sub context menu when clicking on the directory.
you can use %1 in the command to get the name of the item clicked by the user.
This is working for directories. Should work fine for files.