Start up cmder ConEmu console in a specific folder
Asked Answered
T

9

37

I want start my Cmder console in this route C:\xampp\htdocs, but I don't understand the syntax of 'Task parameters'. For example:

 `/icon "%CMDER_ROOT%\cmder.exe`"

Can anyone translate for this? C:\xampp\htdocs to -> /icon "%CMDER_ROOT%\cmder.exe"

So I could edit the config and place my custom folder: enter image description here

Thank you very much.

Thirtytwo answered 11/8, 2015 at 5:20 Comment(0)
C
19

Change %USERPROFILE% to desired folder instead.

Cockneyism answered 11/8, 2015 at 7:48 Comment(2)
Exactly as I've said. Replace %USERPROFILE% with C:\xampp\htdocsCockneyism
In fact, syntax with examples is described thoroughly in docs: conemu.github.io/en/NewConsole.htmlCockneyism
H
51

Go to Setup and Click on 'Startup dir...' button and specify startup directory. As you can see in example bellow startup directory is C:\DEV enter image description here

Heshum answered 15/5, 2017 at 18:31 Comment(2)
As of version 171025, this is the solution, not to mention that it is a lot cleaner than the others suggested.Culinarian
It should be noted that this solution has side effect that "cmder here" contextual menu does not work anymore. It will always open the startup directory you have set up. See here for more information.Source
C
19

Change %USERPROFILE% to desired folder instead.

Cockneyism answered 11/8, 2015 at 7:48 Comment(2)
Exactly as I've said. Replace %USERPROFILE% with C:\xampp\htdocsCockneyism
In fact, syntax with examples is described thoroughly in docs: conemu.github.io/en/NewConsole.htmlCockneyism
S
6

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

Shook answered 16/8, 2016 at 8:12 Comment(0)
T
6

Two ways:

  1. If you want to change the location PER task: do what "Maximus" said, change %USERPROFILE% to the specific location. The downside is that when creating a new console window, the "startup directory for new process" (see image below) will still be the default ConEmu installation directory.
  2. If you want to change the "Startup directory for new process:" location (from the default ConEmu installation directory to custom) when creating a new console:

enter image description here

Then create a shortcut for ConEmu / Cmder and change the "Start in:" attribute in the shortcut properties; like so:

enter image description here

Now simply use the shortcut instead of the exe. This has the benefit of changing the start location for ALL the tasks (all terminals you have setup).

Took answered 7/5, 2017 at 21:36 Comment(0)
R
4

you can do it like this:

  1. edit <APP_DIR>/config/user-startup.cmd file,append a line(suppose dir is 'e:'):

    @cd /d "e:"

  2. restart cmder.

ref:

cmder config

Rival answered 17/6, 2016 at 2:16 Comment(0)
M
4

For last version, you can do this:

  1. Open Cmder
  2. Presh: Windows + ALT + T enter image description here
  3. Push "Startup dir..." button
  4. Select Folder enter image description here
Mixon answered 6/4, 2019 at 15:49 Comment(0)
P
3

In the cmder/vendor/init.bat

Find this line

:: Set home path

And before it add

@cd /d "C:/YOUR_DIR_NAME/"


REF

Paronym answered 9/12, 2016 at 0:25 Comment(1)
Vendor directory is not supposed to be edited by the end user and will be overwritten when user unpacks a new version of cmder. Use the config directory instead. See github.com/cmderdev/cmder#upgrading point 2 last bullet. "Editing files under [cmder_root]/vendor is not recommended since you will need to re-apply these changes after any upgrade. All user customizations should go in [cmder_root]/config folder."Branum
N
1

I added the line as in the screenshot. It is working for me.

enter image description here

Neoplasticism answered 15/6, 2022 at 5:2 Comment(0)
T
0

Edit the file: \CMDER_DIRECTORY\config\user-profile.cmd

cd C:\xampp\htdocs

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.
Telefilm answered 12/4, 2018 at 20:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.