Two short scripts for Cygwin-Windows interoperation

Christian Franke
Thu Jan 4 22:39:00 GMT 2007

Igor Peshansky wrote:
> ...
> The point I was making was that maybe we could add another option to
> cygpath to retrieve the "My Documents" path...  Opinions?

Yes, good point. I would suggest:

-M, --mydocs    output 'My Documents' directory

and as an extension for still missing folders:

-F n, --folder=n   output special folder with CSIDL value n (with 0xHEX 


$ cygpath -M
/cygdrive/c/Documents and Settings/USER/My Documents

$ cygpath -F 5
/cygdrive/c/Documents and Settings/USER/My Documents

$ cygpath -F 0x19
/cygdrive/c/Documents and Settings/All Users/Desktop

$ cygpath -F 0x1a
/cygdrive/c/Documents and Settings/USER/Application Data

$ cygpath -F 0x35
/cygdrive/c/Documents and Settings/All Users/My Music

With a simple wrapper script, all symbolic may be used:

n="$(sed -n 's,#define CSIDL_'"$1"'\t\([0-9]*\),\1,p' 
cygpath -F ${n:?"$1 not found"}

Thanks for any comment


Unsubscribe info:
Problem reports:

More information about the Cygwin mailing list