How to replace the 'cmd' alias in windows?
win + r -> cmd
-> enter
How to replace the alias of cmd?
I want to run cmder instead of default cmd.exe
Solution 1:
Windows uses the registry entry HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths
to register full paths of applications which are visible from the Win+R shortcut. We can use the same behavior by creating an entry for cmd.exe here.
Use the portable program AppPaths to safely write/edit the entry for cmd.exe to reflect the full path to cmder.exe and save. No reboot is required. You could manually write to the registry as well, but the app tests for errors before saving. Note that you will need admin rights either way.
EDIT For posterity, here are the steps for manually editing the registry as well.
Note that in the following, the alias cmd
== cmder
will be set for all users of the PC. If you only want the mapping for your user account, replace the registry path HKEY_LOCAL_MACHINE
with HKEY_CURRENT_USER
in the following.
-
Run
regedit
and go toHKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths
. You might need admin rights. -
Create a new key with the name
cmd.exe
i.e.HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths\cmd.exe
-
Modify the
Default
string in the newly created key to reflect the path to cmder.exe e.g.C:\tools\cmder\cmder.exe
-
In the
cmd.exe
key folder, create a new string called 'Path' and give it the value of the folder where cmder.exe is located. For the example path in step 3, this would beC:\tools\cmder
. This step is not mandatory. It adds the directory to the PATH variable the cmder.exe inherits. This is useful if the directory contains any helper executables required by cmder.exe.