windows 在特定文件夹中启动 cmder ConEmu 控制台

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/31933766/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 19:13:07  来源:igfitidea点击:

Start up cmder ConEmu console in a specific folder

windowscmdconemucmder

提问by Funny Frontend

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

我想在这条路线C:\xampp\htdocs 中启动我的 Cmder 控制台,但我不明白“任务参数”的语法。例如:

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

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

有谁能翻译一下吗?C:\xampp\htdocs to -> /icon "%CMDER_ROOT%\cmder.exe

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

所以我可以编辑配置并放置我的自定义文件夹: 在此处输入图片说明

Thank you very much.

非常感谢。

采纳答案by Maximus

Change %USERPROFILE%to desired folder instead.

%USERPROFILE%改为更改为所需的文件夹。

回答by Vlad Bezden

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

转到设置并单击“启动目录...”按钮并指定启动目录。正如您在示例波纹管中看到的启动目录是 C:\DEV 在此处输入图片说明

回答by hrvojematijevic

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

说明:打开 Cmder -> 设置 -> 任务 -> 选择 {cmd::Cmder}(在我的例子中)。在底部(文本区域下方),您有一个名为“启动目录...”的按钮,然后选择启动目录。关闭cmder,然后重新开始。就是这样,享受

回答by zhu wang

you can do it like this:

你可以这样做:

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

    @cd /d "e:"

  2. restart cmder.
  1. 编辑<APP_DIR>/config/user-startup.cmd文件,追加一行(假设目录是'e:'):

    @cd /d "e:"

  2. 重启cmder。

ref:

参考:

cmder config

命令配置

回答by Artash

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:
  1. 如果您想更改 PER 任务的位置:按照“Maximus”所说的,将 %USERPROFILE% 更改为特定位置。缺点是在创建新的控制台窗口时,“新进程的启动目录”(见下图)仍将是默认的 ConEmu 安装目录。
  2. 如果要在创建新控制台时更改“新进程的启动目录:”位置(从默认的 ConEmu 安装目录到自定义):

enter image description here

在此处输入图片说明

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

然后为ConEmu/Cmder创建一个快捷方式,并在快捷方式属性中更改“开始于:”属性;像这样:

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

现在只需使用快捷方式而不是 exe。这有利于更改所有任务(您设置的所有终端)的开始位置。

回答by Mostafa Nawara

In the cmder/vendor/init.bat

在里面 cmder/vendor/init.bat

Find this line

找到这一行

:: Set home path

:: Set home path

And before it add

在它添加之前

@cd /d "C:/YOUR_DIR_NAME/"

@cd /d "C:/YOUR_DIR_NAME/"



REF

参考文献

回答by essemario

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

编辑文件:\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.

在下面的示例中,我更改了目录并创建了一个 rotine 来启动 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.

回答by Javier

For last version, you can do this:

对于最新版本,您可以这样做:

  1. Open Cmder
  2. Presh: Windows + ALT + Tenter image description here
  3. Push "Startup dir..." button
  4. Select Folderenter image description here
  1. 打开命令
  2. Presh:Windows + ALT + T在此处输入图片说明
  3. 按“启动目录...”按钮
  4. 选择文件夹在此处输入图片说明