Search code examples
windowsvisual-studio-2015cygwinbash

How to make commands available in Cygwin (x86)


I'd like to use Cygwin for windows because I prefer the linux style command prompt over windows cmd. My question is how can I make the rc command (program) available in cygwin, so when I type rc from cygwin it just works. It's currently available only through Visual Studio Developer command prompt but not in cygwin.

The program is located here:

C:\Program Files (x86)\Windows Kits\8.0\bin\x86\rc.exe

I am assuming I should be editing my .bashrc file? Any help would be much appreciated.


Solution

  • If you’re a masochist who loves extra typing, you could provide the full Unix-format path for the command (/cygdrive/c/Program\ Files\ \(x86\)/Windows\ Kits/8.0/bin/x86/rc) each time you want to run the command.

    To save having to specify the full path of the command, add the directory containing the rc program to the PATH environment variable (which is used to search for executable programs). The following command appends the Unix format of this directory path to the PATH:

    PATH=$PATH:"$(cygpath 'C:\Program Files (x86)\Windows Kits\8.0\bin\x86')"
    

    To save having to type this each time Cygwin starts, you can modify a shell start-up file. With a default Cygwin installation, this is best done by adding the above command to the end of ~/.bash_profile.

    Another option would be to add C:\Program Files (x86)\Windows Kits\8.0\bin\x86\ to the Windows PATH environment variable – which is inherited by Cygwin when it starts.