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?

Oleg D.
  • 1,184
  • 11
  • 20

3 Answers3

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)
Jacob Mattison
  • 50,258
  • 9
  • 107
  • 126
8

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

Kenny Gao
  • 81
  • 1
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"
Arno van Oordt
  • 2,912
  • 5
  • 33
  • 63