49
36
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 the registry.
The value of this 'command' key apparently can be any valid command line.
I want to know which 'special variables' are available for use inside this command line.
For example, 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\""
2A warning about
%W
: It is not always available and will throw a cryptic error message if used in yourcommand
value. For example, calling your context menu item on a drive's or a library folder's context menu will not initialize this variable. Avoid its use outside of a file handler's context menu entry. – samthecodingman – 2017-11-05T07:17:24.447Has anybody tried
%~
? I only get an error. – cdlvcdlv – 2018-01-05T22:28:39.8832
%V
should be used if you want directory name, ie. when you want to add your command on context menu when you click on background, not on a single file or a directory name.%L
won't work in that case. – EnterTheNameHere Bohemian – 2018-05-01T06:26:10.33018I don't understand what is meant by "For verbs that are none implies all". – Colonel Panic – 2012-12-17T21:16:21.587