Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Setting up Environment Variables

gesslar edited this pageDec 29, 2024 ·17 revisions

Setting up environment variables

1. How to properly set-up the%CMDER_ROOT% variable?

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:

  1. Press⊞ Win +Pause / Break to open theSystem Preferences, then click onAdvanced system settings.
    • Note: You can also open Advanced system settings by typingSystemPropertiesAdvanced.exe orsysdm.cpl into 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.
  2. 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)
  3. Set the environment variable calledCMDER_ROOT to 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 variableCMDER_ROOT is 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.

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.

2. Setting up%ConEmuDir%

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

3. Adding to%PATH%

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%:

  1. Open the system environmental variables (Win +Pause/BreakAdvanced system settingsEnvironment Variables.)

  2. SelectPATH in 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).

    cmder_path_variable_selection

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

    cmder_path_variable

    If you see a single-line field, simply append the Cmder directory, like this:

    ;C:\bin\Cmder

    So thatC:\test1;C:\test2 now becomesC:\test1;C:\test2;C:\bin\Cmder.

  4. HitOK to save the results.

  5. You might need to Sign off and login again in order to make Windows take the newPATH into effect.

For more information, please also readthis guide.

4. Making sure that it works

  1. Open a newCmd terminal.

  2. Type the following:

    where cmder.exe

    Tip: You can also query any other executable name, such asflute.exe,bash.exe, etc. to find their paths.

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

    cmder-path
  • Otherwise, you'll get the following error message:

    INFO: Could not find files for the given pattern(s).

Description

What is this referring to?

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.

Comparison of both methods

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.

Examples

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"  ],
Clone this wiki locally

[8]ページ先頭

©2009-2025 Movatter.jp