Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .