Oleg D.
Oleg D.

Reputation: 1194

How to make console2 open in a specific folder?

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?

Upvotes: 6

Views: 5833

Answers (3)

Arno van Oordt
Arno van Oordt

Reputation: 3520

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"

Upvotes: 0

Kenny Gao
Kenny Gao

Reputation: 81

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

Upvotes: 8

Jacob Mattison
Jacob Mattison

Reputation: 51082

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)

Upvotes: 17

Related Questions