How to make console2 open in a specific folder?
Asked Answered
J

3

6

With cmd, I can do

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

to open cmd in c:\repo

How to do the same with console2 when using cmd as a shell?

Jonijonie answered 8/6, 2011 at 20:41 Comment(0)
M
17

From the command line options help:

 -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)
Matinee answered 8/6, 2011 at 20:49 Comment(0)
B
8

In 2.00b147, navigate to Edit -> Settings -> Console and enter your desired directory in the Startup dir field.

Baucis answered 8/6, 2011 at 20:57 Comment(1)
How do you set that field to be "The current directory"? -- i.e. setting it to %CD% doesn't work.Prevenient
E
0

Not directly an answer but I found this to be even more convenient: https://github.com/kodLite/cppStartingKitProject-Guide/blob/master/source/Console_2--Usage--Open_Console_Here.rst

This adds an option to the right-click menu to open in that specific folder. Won't work in combination with the "Startup dir""setting though!

Update: Changing the reg a bit will make it even better (open selected folder in Console as well)

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"
Enjoin answered 1/6, 2018 at 8:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.