Change ConEmu's default start directory

113

18

How do I change ConEmu settings such that always when I open it, it will start the cmd in a directory of my choosing instead of the default ConEmu folder?

Nick Ginanto

Posted 2012-10-02T09:01:53.653

Reputation: 1 345

An alt solution is to put some batch jobs somewhere in your path that just cd X:\Some\Long\Directory\Name for dirs that you commonly use. That way you're not limited to one dir, you're not limited to conemu, and you're not limited to just at startup. – Dax Fohl – 2017-03-18T23:42:41.513

Answers

115

In addition to the answer by Bruno Pereira.

1) Another way - create new task with "cmd" in Commands (if not already created) and add following into "Gui args" field of task properties, and choose this task on startup page (radio "Specified named task")

/dir "FullPathToDir"

enter image description here enter image description here

2) One more example - run shell like (Startup -> Command line)

cmd "-cur_console:d:C:\Users\Maks"

enter image description here

Maximus

Posted 2012-10-02T09:01:53.653

Reputation: 19 395

For me, the /dir option didn't work for me, until I released that the option -new_console:d:"%USERPROFILE%" was part of the commands thus overriding my /dir selection. – lordhog – 2016-02-09T02:16:50.477

Just to have in mind, that the Task parameters are in the conEmu format, so even if you set it up for bash you need to use the same dir "C:" syntax – tibbus – 2016-05-01T11:54:41.507

Way more confusing than it should be for such a simple need. – MSC – 2016-06-22T08:17:37.753

the problem is that tasks don't run when I start conemu. – Nick Ginanto – 2012-10-02T09:57:42.820

3Not true. You may choose any named task for startup on "Startup" page. – Maximus – 2012-10-02T10:26:22.003

I get a command group is empty! error when I add the /dir PATH to task parameters – Nick Ginanto – 2012-10-02T10:40:03.670

So? You get a message from program. Why not to make it "not empty"? Add "cmd" to the task command. PS. If message is not clear - suggest your own text. – Maximus – 2012-10-02T11:21:56.583

2I don't understand anything. Your app is excellent but you need to improve the english labels and the GUI usability. With Console2 I just need to go to Edit->Settings and edit the "Startup dir" field, that's all. I'm going to upvote the other answer (and if I could I'd downvote yours), in 2 secs I've changed the startup dir, with your steps is IMPOSSIBLE. – None – 2013-02-23T14:38:37.877

@GabrielLlamas If you read my steps CAREFULLY and realize them one-by-one - your task will be completed. No changes was made to the answer, just screenshot was added. "Specially for..." – Maximus – 2013-02-23T21:54:35.193

2Second approach is much better as it's simpler and doesn't open PowerShell! – Piotr Sobczyk – 2013-04-28T18:30:29.397

I wanted to have Git Bash open in a default directory on load, and to be able to open a new tab with those same settings by simply clicking the plus icon. Combining the first part of this answer from Maximus and Bruno Pereira's solution below I was able to achieve this. – Ian Clark – 2014-02-28T10:57:17.060

43

Just edit your startup shortcut adding the /Dir option as such:

ConEmu /Dir <path to desired directory>

Or on the shortcut properties change the Start in: path to something that fancies you

enter image description here

Bruno Pereira

Posted 2012-10-02T09:01:53.653

Reputation: 6 450

Doesn't work for me at all though. – Xupicor – 2015-07-19T16:10:31.267

Found the culprit - I was invoking bash with -login option, and that would always result in home directory. Now setting up directories with -cur_console or -new_console works fine. – Xupicor – 2015-07-19T16:44:33.717

3I don't know why the above one has more upvotes. This is the correct way to change the "default" start directory, as requested. This will apply to all tasks started in that ConEmu instance. – ELLIOTTCABLE – 2014-06-08T23:33:22.560

6

Open settings:

  1. Startup/Tasks
  2. Create new task
  3. In the first box put a name, e.g. Console
  4. In the third box copy this: C:\Windows\System32\cmd.exe -cur_console:d:D:/
  5. Go to Startup and select the task from the "specified named task" menu.

Restart

user201747

Posted 2012-10-02T09:01:53.653

Reputation:

how do I write a folder path which contains space? – Nick Ginanto – 2013-02-23T15:39:48.207

have you tried to quote the path with " ? – None – 2013-02-23T15:47:48.333

1

Another solution. Create a task and execute it when ConEmu starts.

Create task, e.g. go to folder D:\exampleDir

You can concatenate commands using &

Task creation - ConEmu

Execute task on startup:

Task on startup - ConEmu

Tonatio

Posted 2012-10-02T09:01:53.653

Reputation: 151

1

Another real easy way that worked for me was to open up the Properties of the ConEmu shortcut (in Windows) and then edit the "Start in:" field as shown in the image below.

conemu shortcut properties enter image description here

ojhurst

Posted 2012-10-02T09:01:53.653

Reputation: 11

1

In the task window, as in the top answer, use the following:

/dir %HOMEPATH%

instead of a direct path to your home folder.

baconator

Posted 2012-10-02T09:01:53.653

Reputation: 11

1

The /dir thing didn't work for me with Powershell. I ended up putting the command as powershell.exe -noexit D:\MyDocs like so:

Powershell with default directory

and then set that to be the Startup task as already demonstrated in Maximus' answer:

No

nathanchere

Posted 2012-10-02T09:01:53.653

Reputation: 2 236