reg add HKEY_CLASSES_ROOT\Directory\shell\q_Cmd_Here\command /ve /t REG_SZ /d "cmd.exe /k cd %%1"

reg add HKEY_CLASSES_ROOT\*\shell\q_Cmd_Here\command /ve /t REG_SZ /d "cmd.exe"
reg add HKEY_CLASSES_ROOT\Drive\shell\q_Cmd_Here\command /ve /t REG_SZ /d "cmd.exe /k cd %%1"
以上内容存成批处理运行后就行了,用注册表文件的话内容如下:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\q_Cmd_Here\command]
@="cmd.exe /k cd %1"
[HKEY_CLASSES_ROOT\*\shell\q_Cmd_Here\command]
@="cmd.exe"
[HKEY_CLASSES_ROOT\Drive\shell\q_Cmd_Here\command]
@="cmd.exe /k cd %1"