Cmder: [Help/HowTo] Change default startup path for when "Open Cmder here" is not used?

Created on 1 Apr 2018  Â·  5Comments  Â·  Source: cmderdev/cmder

I searched for this in the open/closed issues but couldn't find anything that matched both criteria.

I'd like to change the default start path of Cmder from C:UsersUser to E:\ while keeping the "Open Cmder here" functionality.

I'm really new with Cmder, but I did try a couple of things:

Added -new_console:d:E:\ to the {cmd::Cmder as Admin} task. That made it always open to E:\, but "Open Cmder here" stopped working (it would just open at E:\).

The second thing I tried was changing the line if not defined HOME set "HOME=%USERPROFILE%" in init.bat to if not defined HOME set "HOME=E:\" but that didn't seem to do anything.

I don't know if I set the home value correctly, or even if HOME is the value I should be changing or not. I thought that %USERPROFILE% might be equivalent to C:\Users\User (which is what Cmder is opening to) so I was hoping that was the right variable to change.

Is there a way to do this? Thank you!

Most helpful comment

@br0wnie - init.bat should not ever be edited, unless you want to contribute changes to the project for all to enjoy!

  1. Use one of the latest nightly builds here
  2. Create a shortcut with a command line like: [path to cmder]\Cmder.exe e:\
  3. Remove /newconsole:d:e:\ from your default cmder task.
  4. Launching the shortcut opens in e:\ and [Folder]->Right Click->Cmder Here opens in that folder.

All 5 comments

@br0wnie Sorry for the late answer.

• As you've noticed, the -new_console:d:E:\ should ONLY be used as a permanent starting directory, though it's appreciated that you read ConEmu documentation.

• The line which defines %HOME% environment variable in init.bat does not specify _where_ to launch Cmder, but rather it's Linux/Cygwin's variant of Windows's %USERPROFILE%, so that shouldn't be usually changed. (Though it's thoughtful of you to try it out!)

• Now, most Terminals open in the user's home directory by default. That's why Cmder also opens in user profile. If you want to open Cmder in another directory, you have to use the /START argument which Cmder provides (it's documented in README file, if you're interested to read!)

You may create a new shortcut (or modify an existing one) to add the /START E:\ argument.
Cheers!

@br0wnie - init.bat should not ever be edited, unless you want to contribute changes to the project for all to enjoy!

  1. Use one of the latest nightly builds here
  2. Create a shortcut with a command line like: [path to cmder]\Cmder.exe e:\
  3. Remove /newconsole:d:e:\ from your default cmder task.
  4. Launching the shortcut opens in e:\ and [Folder]->Right Click->Cmder Here opens in that folder.

It seems to me this answer https://superuser.com/a/1343890/563918 no longer works. Is there ANY way to change the startup dir? It just defaults to the same directory for me. I actually left conemu to cmder for the same reason, and I am thinking there is no difference when it comes to fixing this issue

@samayo may I ask, where is your preferred start-up path?

A couple of suggestions:

I can explain each option in more detail once I get to my PC, if you're interested.

@samayo Current Cmder starts by default in the current working directory.

Download a fresh copy of cmder and compare the text of the task you are using to launch. Chances are you have an old version when the default config hard coded the startup dir.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

giuliannosbrugnera picture giuliannosbrugnera  Â·  3Comments

jenisys picture jenisys  Â·  3Comments

luisrudge picture luisrudge  Â·  3Comments

danwellman picture danwellman  Â·  3Comments

sathishsoundharajan picture sathishsoundharajan  Â·  3Comments