delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/05/04/14:17:44

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.0 required=5.0 tests=AWL,BAYES_20,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,TW_TF,T_TO_NO_BRKTS_FREEMAIL
X-Spam-Check-By: sourceware.org
Message-Id: <E4ED178C-CF07-4B62-A65E-F758F1D56D3A@free.fr>
From: Denis Excoffier <Denis DOT Excoffier AT free DOT fr>
To: cygwin AT cygwin DOT com
Mime-Version: 1.0 (Apple Message framework v936)
Subject: readshortcut: print Target in raw format
Date: Tue, 4 May 2010 20:17:21 +0200
Cc: Denis Excoffier <Denis DOT Excoffier AT free DOT fr>
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

Hello,

On my Cygwin system (XP) i have (probably like most of you) the  
following
commands:
1) readshortcut.exe, from the package cygutils-1.4.2
2) SHORTCUT.EXE, from %windir%/system32 (or equivalent)

They are both consistent: in case of a `Target' that contains an
environment variable, the variable is resolved, for example:

% readshortcut -tfw X-Cygwin.bat.lnk
Target: C:\Users\me\me\cygwin2010b\Cygwin.bat
% /cygdrive/c/winnt/system32/SHORTCUT.EXE -u t X-Cygwin.bat.lnk
Target: C:\Users\me\me\cygwin2010b\Cygwin.bat

However, in the `Properties' of the Shortcut, i can read in the Target
cell:
`%myhome%\cygwin2010b\Cygwin.bat'
I would have preferred readshortcut.exe to show this raw path, with
the environment variable %myhome% still unresolved.

So i went into cygutils-1.4.2/src/readshortcut/readshortcut.c and
discovered that, if the last argument of GetPath() is set to
`SLGP_RAWPATH' (this is ok), the value of SLGP_RAWPATH is
obtained from `#include <shlobj.h>' (this is still ok), but it is
redefined later with `#define SLGP_RAWPATH 0' (this is *not* ok,
it should be 4).

It seems that the intentions of the original writer were to
print the raw path, but someone later changed that to be consistent
with SHORTCUT.EXE (or due to some other reason).

Please modify readshortcut.exe in order to be able to really print the
raw path (e.g. with an extra option). Thanks in advance.

Regards.

Denis Excoffier.


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

- Raw text -


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