Cmder: Change Tasks default start directory

Created on 22 Jun 2017  路  8Comments  路  Source: cmderdev/cmder

Similar to #203, I want Cmder to start from the opened directory when I run it from Windows explorer address bar, like so:
cmder_issue

I messed a bit with the settings and made it work by removing %USERPROFILE% from the task command:

cmd /k "%ConEmuDir%\..\init.bat"  -new_console:d:

Can this be the new default if it doesn't break anything?

Most helpful comment

@alex-salas this might not be the best solution, but looks like %ConEmuWorkDir% holds the path:
image

Try adding startup commands to your batch/powershell user profile files respectively (located in %CMDER_ROOT%\config\):

REM user-profile.cmd
pushd %ConEmuWorkDir%
# user-profile.ps1
push-location -path "$env:ConEmuWorkDir"

HTH

All 8 comments

Being trying to make this work for a couple of days. I didn't have any problems setting this thing up a year ago. I could just go to the address bar and open the terminal in that path 馃

Even tho I'm creating a new task with

  • cmd /k "%ConEmuDir%\..\init.bat" -new_console:%__CD__%
    or
  • cmd /k "%ConEmuDir%\..\init.bat" -new_console:d:

It's not working for me.

image

image

My Cmder is still being opened in %USERPROFILE% 馃槥

Which version do you have installed? I'll try to reproduce this.

@bdr00 I have v1.3.4

@alex-salas this might not be the best solution, but looks like %ConEmuWorkDir% holds the path:
image

Try adding startup commands to your batch/powershell user profile files respectively (located in %CMDER_ROOT%\config\):

REM user-profile.cmd
pushd %ConEmuWorkDir%
# user-profile.ps1
push-location -path "$env:ConEmuWorkDir"

HTH

Can confirm this is working after adding the code @bdr00 mentioned in the user-profile.cmd file.
Thank you.

image
loadiing

Cmder from the Windows Explorer address bar does not work for me, even after setting up a startup task exactly as @alex-salas did. Instead, it opens up my default Web browser at cmder/
Moreover, if I add the code @bdr00 mentioned in the user-profile.cmd file, then Cmder here starts opening at %USERPROFILE% instead of the current folder. Any ideas? I also am on v1.3.4.

@giuliannosbrugnera Did you add the CMDER_ROOT / CMDER_HOME to your Windows path?

@alex-salas I didn't, that fixed the Windows Explorer address bar, thanks :)
Cmder here still opens at %USERPROFILE% though 馃 although I am sure I will be using only from the address bar now :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AaronKaa picture AaronKaa  路  3Comments

jenisys picture jenisys  路  3Comments

edgariscoding picture edgariscoding  路  3Comments

Joe1992w picture Joe1992w  路  3Comments

vincentntang picture vincentntang  路  3Comments