I have Cmder for Windows it has default path c:\Users\ username and I want to change it to any other path I like or want. How do I change it ?
Also cmder can replace cmd.exe meaning is it possible to set cmder as default program insted of cmd.exe
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.
Sign up to join this communityI have Cmder for Windows it has default path c:\Users\ username and I want to change it to any other path I like or want. How do I change it ?
Also cmder can replace cmd.exe meaning is it possible to set cmder as default program insted of cmd.exe
As of cmder v1.3.6:
Go to 'settings'
In the settings group 'Startup', click on 'Tasks'
Click the console you want to modify (e.g. cmd::Cmder, cmd::Cmder as Admin, bash::bash etc.)
Click the button that says 'Startup dir...'
Select the directory you want the console to start up in by default
Enjoy
{cmd::Cmder as Admin}
you may get the error *cmd is not recognized as an internal or external command, operable program or batch file.
You will need to rearrange the command in the dialog window that is created for you from -new_console:d:C:\projects *cmd /k ""%ConEmuDir%\..\init.bat" "
to *cmd /k ""%ConEmuDir%\..\init.bat" " -new_console:d:C:\projects
.
Oct 16, 2020 at 16:10
In the init.bat
file in ~/cmder/vendor
, before
:: Set home path
add
@cd /d "C:/YOUR_PREFERRED_FOLDER/"
For those who none of the above solutions worked (Cmder keeps reverting back to old path), here's what I did to fix it:
C:/OLD_FOLDER/
C:/YOUR_PREFERRED_FOLDER/
. For me, the issue was in ConEmu.xml
which was preventing startup folder changes.
In cmder\vendor\init.bat
there are these lines:
:: Set home path
if not defined HOME set "HOME=%USERPROFILE%"
%lib_console% debug_output init.bat "Env Var - HOME=%HOME%"
set "initialConfig=%CMDER_ROOT%\config\user_profile.cmd"
if exist "%CMDER_ROOT%\config\user_profile.cmd" (
REM Create this file and place your own command in there
%lib_console% debug_output init.bat "Calling - %CMDER_ROOT%\config\user_profile.cmd"
call "%CMDER_ROOT%\config\user_profile.cmd"
)
So to change your default path for cmd.exe
all you need to do is to edit your cmder\config\user_profile.cmd
file and add something like this at its end:
if not defined CMDER_HOME set "CMDER_HOME=%HOME%"
cd %CMDER_HOME%
I'd recommend using a specific environment variable like %CMDER_HOME%
because if you use the same cmder
config on multiple hosts, you can set this environment variable to the appropriate directory on each host and use cmder
with the exact same configuration. cmder
provides a default value for %HOME%
, as you can see above, so that seems to be a safe failback value (you get the same behaviour without that line too, but that's probably because the cd
failed; which feels nicer to be avoided).
Also cmder can replace cmd.exe meaning is it possible to set cmder as default program insted of cmd.exe
I'm not sure what you mean by this. cmder
is just a console emulator that nicely integrates other terminal emulators into its windows. One of these terminal emulators is cmd.exe
. So cmder
's purpose isn't really to replace cmd.exe
, although most certainly you can just create a new tab in cmder
whenever you would otherwise spin up a new cmd
window. It would be probably useful to know where and why you'd like to use cmder
by default instead of cmd
?