delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/01/04/14:41:38

X-Spam-Check-By: sourceware.org
Message-ID: <459D5852.8010407@t-online.de>
Date: Thu, 04 Jan 2007 20:41:06 +0100
From: Christian Franke <Christian DOT Franke AT t-online DOT de>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.7) Gecko/20060910 SeaMonkey/1.0.5
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: Two short scripts for Cygwin-Windows interoperation
References: <loom DOT 20070104T172439-137 AT post DOT gmane DOT org> <Pine DOT GSO DOT 4 DOT 63 DOT 0701041220120 DOT 15041 AT access1 DOT cims DOT nyu DOT edu>
In-Reply-To: <Pine.GSO.4.63.0701041220120.15041@access1.cims.nyu.edu>
X-ID: S8V2z0ZewefN9sgSfNPaiPSd4x0vnCtPGGQ4bWYDLZQi+UXjF5Avra
X-TOI-MSGID: c339fbf8-cefd-45d9-a192-75b844b903f0
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Igor Peshansky wrote:
> ...
> The Desktop path can be obtained in a general way by "`cygpath -uD`".
> Unfortunately, there is no such ready shortcut for "My Documents", though
> "`cygpath -uH`/$USER/My Documents" should work for most installations of
> the English versions of Windows.
>   

The function SHGetSpecialFolderLocation() used by cygpath obtains (most 
of?) these pathnames from the registry.

To retrieve the cygwin path of "My Documents" folder, use:

$ cygpath -u "$(cat /proc/registry/HKEY_CURRENT_USER/Software/\
Microsoft/Windows/CurrentVersion/Explorer/Shell\ Folders/Personal)"

This works also on non-English XP.
It should also work on Vista (where ugly "\Documents and 
Settings\USER\My Documents" is finally replaced by 
"\Users\USER\Documents" ;-)

Christian


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019