I found a way how to add a context menu, when I right click in a Windows explorer, to open command line in a current directory.
It is sufficient to create two Windows registry entries:
HKEY_CLASSES_ROOT\Directory\shell\CommandPrompt e.g. with value "Open CMD here..."
and
HKEY_CLASSES_ROOT\Directory\shell\CommandPrompt\command with value
"cmd.exe /k cd /d %1"
or simple creating a file cmd.reg and executing it:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\CommandPrompt]
@="Open CMD here..."
[HKEY_CLASSES_ROOT\Directory\shell\CommandPrompt\command]
@="cmd.exe /k cd /d %1"
But how can I achieve the same thing, which will force cmd.exe to "Run as Administrator"?