3

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?

4
  • My choice would be an underscore to replace any non-alphanumeric characters.
    – o.k.w
    Mar 5, 2010 at 7:40
  • why do you 'cygwin' around in $PROGRAMFILES anyway?
    – akira
    Mar 5, 2010 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, 2010 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, 2010 at 23:52

3 Answers 3

9

Symbolic links in cygwin can help fix this:

ln -s /cygdrive/c/Program\ Files\ \(x86\) /ProgramFilesx86
3

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.

2
  • what an interesting idea... so I could go into my PATH and update these all?
    – aronchick
    Mar 5, 2010 at 21:57
  • yes, that is what I have done.
    – dogbane
    Mar 6, 2010 at 12:18
1

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.

1

You must log in to answer this question.

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