Setting cmder startup directory.
I'm trying to change the directory in which cmder starts up. To do this, I just added the following to the end of my init.bat file:
cd D:/work
d:
Its not very elegant but it works, and it prints some funny message as the first line of text:

Is there a better way to do this? Or at least get rid of the first line message?
Looks like you saved the init.bat file as UTF-8 with BOM try to save it without BOM
You could switch in one command with: cd /d D:\work
Thanks that fixed it. Not sure why the BOM was saved, I opened in Notepad++ and my settings is set not to save with BOM. However, opening the file in VIM showed the characters.
Instructions: Open Cmder -> Settings -> Tasks -> select {cmd::Cmder} (in my case). On the bottom (below textarea) you have button named "Startup dir...", and than select startup directory. Close cmder, and start again. That's it, enjoy
While hmatijevic's tip was helpful, it took me a while to process as a Cmder noob. In the last step, replace %USERPROFILE% with N:\ where N:\ is the drive or location you wish to start in.
@hmatijevic very helpful,thanks! But one thing must be noticed is that we should delete the default startup directory setting before clicking the "Startup dir..." bottom.
In my case,the default {cmd::Cmder} looks like this:
cmd /k "%ConEmuDir%\..\init.bat" -new_console:d:%USERPROFILE%
Then,i change to this:
cmd /k "%ConEmuDir%\..\init.bat" -new_console:d:G:\myfoldername
It works great :)
Click Settings -> Startup -> Tasks
Select the first Predefined task, in my case {Shells::cmd}
On the right, under Task parameters, enter e.g.:
/dir "c:\github"
Interestingly enough Under "Startup directory for new process:" it still says a different directory than what actually initiates in a new cmder tab...huh oh well
@akinhwan can you try the latest master build and tell me if it is better now? https://ci.appveyor.com/project/MartiUK/cmder/build/1.0.521-master/artifacts
@Stanzilla, in case you were still looking for feedback about your last post: I was running into this issue with 1.3.3, and 1.3.4, but the build you posted above works for me.
This doesn't seem to work for me:
cmd /k "%ConEmuDir%\..\init.bat" -new_console:d:C:\foo
It still opens in %USER_PROFILE%. Any suggestions?
try this: for bash::Git bash : Changing program startup folder in settings —> task, choose btn "startup dir..." and placing necessary directory. You can place checkbox "Default task for new console" and put a hotkey. Using this hotkey - new "bash::Git bash" tab will be opened whis YOUR_PATH .
Edit the file: \CMDER_DIRECTORY\config\user-profile.cmd
d:
cd Work
On bellow example, I've changed the directory and created a rotine to start homestead.
:: use this file to run your own startup commands
:: use in front of the command to prevent printing the command
:: uncomment this to have the ssh agent load when cmder starts
:: call "%GIT_INSTALL_ROOT%/cmd/start-ssh-agent.cmd"
:: uncomment this next two lines to use pageant as the ssh authentication agent
:: SET SSH_AUTH_SOCK=/tmp/.ssh-pageant-auth-sock
:: call "%GIT_INSTALL_ROOT%/cmd/start-ssh-pageant.cmd"
:: you can add your plugins to the cmder path like so
:: set "PATH=%CMDER_ROOT%\vendor\whatever;%PATH%"
e:
cd ../../../../../Homestead
@echo off
:Ask
echo Would you like to start the Homestead?(Y/N)
set INPUT=
set /P INPUT=Yes(y) ou No(n): %=%
If /I "%INPUT%"=="y" goto yes
If /I "%INPUT%"=="Y" goto yes
If /I "%INPUT%"=="n" goto no
cls
echo Invalid option
echo -
echo -
goto Ask
:yes
vagrant up
goto finalMessage
:no
cls
goto finalMessage
:finalMessage
echo Your console is ready Mr. Chapela.
Instructions: Open Cmder -> Settings -> Tasks -> select {cmd::Cmder} (in my case). On the bottom (below textarea) you have button named "Startup dir...", and than select startup directory. Close cmder, and start again. That's it, enjoy
Too bad this is working, but then the "Open CMDer here" from the context menu (windows) isn't working anymore. It is forced to the startup directory all the time. I would like to set a default directory to start when not using "Open CMDer here"
@bertoost don't set that setting. Cmder is a package of 4 different products each with its own individual settings that sometimes conflict. Cmder.exe will open in the current working directory or a directory you supply on the command line. If you want cmder to launch from a shortcut in a certain folder every time configure the shortcut start directory instead. Cmder here will continue to work as expected this way.
@daxgames Is there any solutions working both Cmder here and set a default directory to start when not using "Open CMDer here" ?
Cnder.exe will open in the current working directory by default or you can 'cmder folder-name'

I found a way.
Yup that is correct
Wow, today I learned that Windows shortcuts let you choose where to start a program in them. Setting it to %USERPROFILE% did exactly what I wanted. Thanks!
If you don't want to open a new console, you can do this:
- open cmder settings
- under Startup / Tasks, select you default task ({cmd::Cmder})
- in the "Task parameters", add /dir with you cmder default path:
/dir "C:\CmderDirectory" - Save settings
