Take the 2-minute tour ×

I do a lot of bouncing between cygwin and Windows command shell, and I always end up in pain from miscellaneous space and/or parenthesis issues (MS you really killed me with "Program Files (x86)"). What's the best/easiest way to just rename these directories to drop the spaces and/or parens?

share|improve this question
My choice would be an underscore to replace any non-alphanumeric characters. –  o.k.w Mar 5 '10 at 7:40
why do you 'cygwin' around in $PROGRAMFILES anyway? –  akira Mar 5 '10 at 8:01
You can't rename these directories without getting into heaps of trouble. Some variant of heavyd's answer is probably the way to go. –  harrymc Mar 5 '10 at 12:26
i access %PROGRAM FILES% because that's how i get to my programs. Not sure what the alternative is. –  aronchick Mar 5 '10 at 23:52
add comment

3 Answers

up vote 8 down vote accepted

Symbolic links in cygwin can help fix this:

ln -s /cygdrive/c/Program\ Files\ \(x86\) /ProgramFilesx86
share|improve this answer
add comment

Learn to use Windows "short names". For example, the short name for "Program Files" is PROGRA~1 and "Documents and Settings" is DOCUME~1.

Type "dir /x" to see short names.

share|improve this answer
what an interesting idea... so I could go into my PATH and update these all? –  aronchick Mar 5 '10 at 21:57
yes, that is what I have done. –  dogbane Mar 6 '10 at 12:18
add comment

In Windows you could create a softlink to the directory, using a desired short name, which in reality points to the real destination. Windows 7, and I think Vista, has this capability built in. Similar functionality can be added to XP via the Junction software.

share|improve this answer
Can be accessed in XP via the Junction software. technet.microsoft.com/en-us/sysinternals/bb896768.aspx –  Nathaniel Mar 5 '10 at 19:49
add comment

Your Answer


