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
Start up cmder ConEmu console in a specific folder
提问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:
Thank you very much.
非常感谢。
采纳答案by Maximus
Change %USERPROFILE%
to desired folder instead.
%USERPROFILE%
改为更改为所需的文件夹。
回答by Vlad Bezden
回答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:
你可以这样做:
edit
<APP_DIR>/config/user-startup.cmd
file,append a line(suppose dir is 'e:'):@cd /d "e:"
- restart cmder.
编辑
<APP_DIR>/config/user-startup.cmd
文件,追加一行(假设目录是'e:'):@cd /d "e:"
- 重启cmder。
ref:
参考:
回答by Artash
Two ways:
两种方式:
- 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.
- 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:
- 如果您想更改 PER 任务的位置:按照“Maximus”所说的,将 %USERPROFILE% 更改为特定位置。缺点是在创建新的控制台窗口时,“新进程的启动目录”(见下图)仍将是默认的 ConEmu 安装目录。
- 如果要在创建新控制台时更改“新进程的启动目录:”位置(从默认的 ConEmu 安装目录到自定义):
Then create a shortcut for ConEmu / Cmder and change the "Start in:" attribute in the shortcut properties; like so:
然后为ConEmu/Cmder创建一个快捷方式,并在快捷方式属性中更改“开始于:”属性;像这样:
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
回答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.