Une approche alternative pour votre référence:
Enregistrer les suivis sous *.reg
et importer dans le registre (adapté de Sully @ Wilders Security )
Éditeur de registre Windows version 5.00
[HKEY_CLASSES_ROOT \ * \ shell \ Mon menu]
"Icon" = "shell32.dll, 43"
"Sous-commandes" = ""
[HKEY_CLASSES_ROOT \ * \ shell \ Mon menu \ shell \ menu1]
"MUIVerb" = "Éditeur de texte"
"SubCommands" = ""
[HKEY_CLASSES_ROOT \ * \ shell \ Mon menu \ shell \ menu1 \ shell \ item1]
"MUIVerb" = "Bloc-notes ++"
[HKEY_CLASSES_ROOT \ * \ shell \ Mon menu \ shell \ menu1 \ shell \ item1 \ command]
@ = "C: \\ Program Files \\ npp \\ notepad ++. Exe% 1"
[HKEY_CLASSES_ROOT \ * \ shell \ Mon menu \ shell \ menu1 \ shell \ item2]
"MUIVerb" = "Texte sublime"
[HKEY_CLASSES_ROOT \ * \ shell \ My Menu \ shell \ menu1 \ shell \ item2 \ command]
@ = "C: \\ Program Files \\ Sublime Text 3 \\ sublime_text.exe% 1"
[HKEY_CLASSES_ROOT \ * \ shell \ Mon menu \ shell \ menu2]
"MUIVerb" = "Audio"
"SubCommands" = ""
[HKEY_CLASSES_ROOT \ * \ shell \ Mon menu \ shell \ menu2 \ shell \ item1]
"MUIVerb" = "Audacity"
[HKEY_CLASSES_ROOT \ * \ shell \ Mon menu \ shell \ menu2 \ shell \ item1 \ command]
@ = "audacity.exe% 1"
Références
AskVG
Directory Opus Resource Center
Addendum: menu Pseudo-dossier
Enregistrer sous C:\copy.js
fonction fnCopyHereJ (src, dest) {
var objShell = new ActiveXObject ("shell.application");
var objFolder = objShell.NameSpace (dest);
if (objFolder) {
objFolder.CopyHere (src);
} autre {
WScript.echo ("Dossier non valide:" + dest);
}
}
args = WScript.Arguments;
fnCopyHereJ (args (0), args (1));
Importer dans le registre
Éditeur de registre Windows version 5.00
[HKEY_CLASSES_ROOT \ * \ shell \ Mon menu]
"Icon" = "shell32.dll, 43"
"Sous-commandes" = ""
[HKEY_CLASSES_ROOT \ * \ shell \ Mon menu \ shell \ menu1]
"Icon" = "imageres.dll, -113"
"MUIVerb" = "Image"
"SubCommands" = ""
[HKEY_CLASSES_ROOT \ * \ shell \ Mon menu \ shell \ menu1 \ shell \ item1]
"Icon" = "shell32.dll, 3"
"MUIVerb" = "Dossier 1"
[HKEY_CLASSES_ROOT \ * \ shell \ Mon menu \ shell \ menu1 \ shell \ item1 \ command]
@ = "wscript C: \\ copy.js% 1 C: \\ Users \\ 01 \\ Pictures"
[HKEY_CLASSES_ROOT \ * \ shell \ Mon menu \ shell \ menu1 \ shell \ item2]
"Icon" = "shell32.dll, 3"
"MUIVerb" = "Dossier 2"
[HKEY_CLASSES_ROOT \ * \ shell \ My Menu \ shell \ menu1 \ shell \ item2 \ command]
@ = "wscript C: \\ copy.js% 1 \" C: \\ New Folder \ ""
[HKEY_CLASSES_ROOT \ * \ shell \ Mon menu \ shell \ menu2]
"Icon" = "imageres.dll, -108"
"MUIVerb" = "Musique"
"SubCommands" = ""
[HKEY_CLASSES_ROOT \ * \ shell \ Mon menu \ shell \ menu2 \ shell \ item1]
"Icon" = "shell32.dll, 3"
"MUIVerb" = "Dossier 1"
[HKEY_CLASSES_ROOT \ * \ shell \ Mon menu \ shell \ menu2 \ shell \ item1 \ command]
@ = "wscript C: \\ copy.js% 1 C: \\ Users \\ 01 \\ Music"
[HKEY_CLASSES_ROOT \ Directory \ shell \ My Menu]
"Icon" = "shell32.dll, 43"
"ExtendedSubCommandsKey" = "* \\ shell \\ Mon menu"
Références
Appelez une copie de Windows à partir de la
méthode PowerShell Folder.CopyHere (Windows)
Menus contextuels en cascade via des entrées de registre statiques et ExtendedSubCommandsKey