如何让Console2在特定文件夹中打开?

6

使用 cmd,我可以做到:

cmd /K cd /D "c:\repo"

在c:\repo中打开cmd的方法:

当使用cmd作为shell时,如何在console2中执行相同操作?

3个回答

17

从命令行选项帮助文档中获取:

 -d <directory> 

 Specifies a startup directory. If you want to parametrize
 startup dirs, you need to specify startup directory parameter as "%1"\
 (backslash is outside of the double quotes)

8
在2.00b147版本中,导航到编辑 -> 设置 -> 控制台,并在启动目录字段中输入您想要的目录。

1
你如何将该字段设置为“当前目录”?即将其设置为“%CD%”无效。 - BrainSlugs83

0

虽然这不是直接的答案,但我发现这更方便: https://github.com/kodLite/cppStartingKitProject-Guide/blob/master/source/Console_2--Usage--Open_Console_Here.rst

这将在右键菜单中添加一个选项,以打开该特定文件夹。 但与“启动目录”设置结合使用时无法正常工作!

更新: 稍微更改注册表将使其更好(还可以在控制台中打开所选文件夹)

Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\Console2]
@="Open in Console2"
[HKEY_CLASSES_ROOT\Directory\shell\Console2\command]
@="C:\\Path\\To\\Console\\2\\Console2.exe -d %0"
[HKEY_CLASSES_ROOT\Directory\Background\shell\Console2]
@="Open Console2 Here"
[HKEY_CLASSES_ROOT\Directory\Background\shell\Console2\command]
@="C:\\Path\\To\\Console\\2\\Console2.exe"

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接