- Notifications
You must be signed in to change notification settings - Fork2.1k
Setting up Environment Variables
Many tasks with Cmder will need you to set the correct%CMDER_ROOT% environment variable path in your system.
Follow the instructions below to define it:
- Press⊞ Win +Pause / Break to open theSystem Preferences, then click onAdvanced system settings.
- Note: You can also open Advanced system settings by typing
SystemPropertiesAdvanced.exeorsysdm.cplinto the Run Menu (Win+R). - Note: From Windows 11 and onwards, the keyboard shortcut opens theSystem Settings app instead. From there, expand theDevice specifications and then click onAdvanced system settings link.
- Note: You can also open Advanced system settings by typing
- In theAdvanced system settings window, click on theEnvironment Variables button, then:
- If you installed Cmder to a directory for all users, look atSystem variables. (For example,
C:\Program Files,C:\utils,C:\tools) - If you installed Cmder in portable mode, look atUser variables. (For example,
C:\Users\Username\and any path below it)
- If you installed Cmder to a directory for all users, look atSystem variables. (For example,
- Set the environment variable called
CMDER_ROOTto point to the path of your Cmder root installation folder
(e.g.C:\apps\cmder,C:\Program Files (x86)\Cmder, or wherever you've installed Cmder.)- If the variable
CMDER_ROOTis not defined, click onNew…and add the variable. - If the variable already exists, only check if the value is correct, replace the value if it's not.
There isno need to create duplicate variables.
- If the variable
Note: If the Cmder installation path is something likeC:\Program Files, it should go into theSystem variables. If it's something likeC:\Users\YourUsername\AppData, then it should go into theUser variables section.

Cmder comes withConEmu as the console emulator. In case%ConEmuDir% is also not defined in your system, you could follow thesteps 1-3 from above, and use the following values when creating your variable:
- Variable Name:
%ConEmuDir% - Value:[cmder_root]\vendor\conemu-maximus5e.g.:
C:\apps\cmder\vendor\conemu-maximus5
We recommend adding your Cmder installation directory to thepath variable. It has the benefit oflaunching Cmder from the explorer, the terminal, and the start menu.
Here's the quick steps to add Cmder to%PATH%:
Open the system environmental variables (Win +Pause/Break →Advanced system settings →Environment Variables.)
Select
PATHin eitherUser variables orSystem variables,depending on whether you've put Cmder on a user folder (e.g.C:\Users\Samuel\Dropbox\apps\Cmder) or in a system-wide directory (e.g.C:\apps\Cmder).ClickEdit… to display the PATH variable.
Depending on your Windows version, you might see different dialogs.
If you see the following window, simply clickNew and type in your Cmder directory, example:C:\bin\Cmder

If you see a single-line field, simply append the Cmder directory, like this:
;C:\bin\Cmder
So that
C:\test1;C:\test2now becomesC:\test1;C:\test2;C:\bin\Cmder.HitOK to save the results.
You might need to Sign off and login again in order to make Windows take the new
PATHinto effect.
For more information, please also readthis guide.
Open a new
Cmdterminal.Type the following:
where cmder.exeTip: You can also query any other executable name, such as
flute.exe,bash.exe, etc. to find their paths.Check the results:
If the executable is present in any of the
%PATH%environment variable paths, you'll get the full path to the executable (multiple if found in more than one paths).
Otherwise, you'll get the following error message:
INFO: Could not find files for the given pattern(s).
Cmder can be used in a variety of different settings, and supports many external options and configurations to fit with your needs.
When integrating, modding and/or using Cmder, you may often find the need of referring to the absolute path in which the Cmder is installed, e.g.:C:\apps\cmder orC:\Program Files\Cmder. We usually refer to this directory as[cmder_root] as in our documents and the Wiki.

When you set the system%CMDER_ROOT% environment variable, you assign a fixed path to configuration files and avoid correcting the path each time you change the directory -- and if it changes, you only have to modify the variable once, instead of going through different configuration files and changing the values there.
Here's a list of comparisons between the two methods:
You can skip setting up the
%CMDER_ROOT%variable, as long as:- the path isn't going to change (e.g. you won't move the directory)
- you refer to the path by other files only once (or a few times at most)
- or maybe you are just testing things out before setting it up properly to use alongside your configuration files.
The only situation in which we advise against setting the environment variable is when you use Cmder on a temporary computer (e.g. launching Cmder from a USB stick on university lab computers).
It is, however,strongly recommended to set a properly definedenvironment variable to point to the installation directory of Cmder.
Note: As a rule of thumb, if you enableContext-menu integration, you should also make sure that the%CMDER_ROOT% environment variable is also defined.
You can use%CMDER_ROOT% in place of the[cmder_root] placeholder wherever you see it in the documents and the Wiki. Example:
"terminal.integrated.shell.windows":"cmd.exe","terminal.integrated.shellArgs.windows": ["/k","[cmder_root]\\vendor\\init.bat" ],
becomes:
"terminal.integrated.shell.windows":"cmd.exe","terminal.integrated.shellArgs.windows": ["/k","%CMDER_ROOT%\\vendor\\init.bat" ],
