-->

Start up cmder ConEmu console in a specific folder

2020-05-18 06:36发布

问题:

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:

Thank you very much.

回答1:

Change %USERPROFILE% to desired folder instead.



回答2:

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



回答3:

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



回答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



回答5:

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:

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

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).



回答6:

In the cmder/vendor/init.bat

Find this line

:: Set home path

And before it add

@cd /d "C:/YOUR_DIR_NAME/"


REF



回答7:

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.


回答8:

For last version, you can do this:

  1. Open Cmder
  2. Presh: Windows + ALT + T
  3. Push "Startup dir..." button
  4. Select Folder