Quel special variables are available quand writing a shell commande for a context menu

When extending the Windows’ shell context menu (e.g. for adding an ‘Open command here’ prompt on directories), a ‘command’ key needs to be created in le registre.

The value of this ‘command’ key apparently can be any valid ligne de commande.

Je veux know which ‘special variables’ are available for use inside this ligne de commande.

Par exemple, I use following command for opening a cmd window from within a directory’s context menu (*):

cmd.exe /e:on /f:on /s /k pushd "%V"

I cannot find any reference to what %V actually means or what the full list of such variables is.

(*)
Following registry keys are created for this:

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\cmdshell]
@=Open Command Prompt Here"

HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\cmdshell\command]
@="cmd.exe /e:on /f:on /s /k pushd \"%V\""


Source : Super User

A comment by Chris Guzak on the Extending Shortcut Menus MSDN article lists the various “ligne de commande variables” that are available:

%* – Replace with all parameters.

%~ – Replace with all parameters starting with and following the second parameter.

%0 or %1 – The first file parameter. For example “C:\Users\Eric\Desktop\New Text Document.txt”. Generally cela devrait be in quotes and the applications ligne de commande parsing should accept quotes to disambiguate files with spaces in the name and different ligne de commande parameters (this is a security best practice and Je crois mentioned in MSDN).

% (where is 2-9) – Replace with the nth parameter.

%s – Show command.

%h – Hotkey value.

%i – IDList stored in a shared memory handle is passed here.

%l – Long nom de fichier form of the first parameter. Notez que Win32/64 applications will be passed the long nom de fichier, whereas Win16 applications get the short nom de fichier. Specifying %l is preferred as it avoids the need to probe for the application type.

%d – Desktop absolute parsing name of the first parameter (for items that don’t have système de fichiers paths).

%v – For verbs that are none implies all. If there is no parameter passed this is the working directory.

%w – The working directory.

So %L or %l should be preferred.

Also see [Batch files - The START command: Windows NT 4/Windows 2000 Syntax](1)