RCC collision in PATH

Having a short command name for easy use means we are bound to get some collisions with rcc. Here is a guide to work with multiple rcc apps.

The most common one seems to be Qt Resource Compiler, but there are many executables named rcc.

To test the problem, you can run:

  • Windows: where rcc
  • macOS & Linux: which rcc

This shows what rcc you get from the system path first.

Setup an alias

Setting up an alias for the rcc command is the easiest way around the problem. It is up to you what you like to type when calling rcc when creating the alias. The examples below use rpa-rcc. While that is longer to write than rcc, the change of another collision is relatively small.

On macOS & Linux:

alias rpa-rcc=/usr/local/bin/rcc rpa-rcc version

On Windows:

On Windows setting up a global, permanent alias is a bit harder than on Linux but doable:

DOSKEY rpa-rcc=C:\Installs\InPath\rcc.exe rpa-rcc version

The alias is lost when you close the command prompt.

To retain the alias whenever you open a command prompt requires a few more steps.

Note: If you have previous DOSKEY setups, add the new alias there instead of making a new one.

  • Create a text file in: %USERPROFILE%\aliases.cmd
  • Add the following content to that file (the path points to where you placed your rcc executable):
    DOSKEY rpa-rcc=C:\Installs\InPath\rcc.exe
  • Open command-prompt and run:
    reg add "HKCU\Software\Microsoft\Command Processor" /v AutoRun /t REG_EXPAND_SZ /d "%USERPROFILE%\aliases.cmd" /f
  • Open a new command prompt and test rpa-rcc
Last edit: December 3, 2020