[python-win32] How to read the target of a Windows Shortcut

Ayaskanta Swain ayaskanta.swain at altair.com
Fri Mar 4 13:27:10 CET 2011



Thank you for sending me the link. I tried it by copying the
"shortcut_target(filename)" function into my script. But it does the
same thing as I had mentioned in my previous e-mail. i.e It returns me
the target path correctly if the target exists physically in my hard
disk, but behaves in a wrongful manner if I delete the target keeping
the shortcut intact (Broken shortcut). In that case it creates an empty
file (0 size) with the same name as that of the existing target &
creates it at the same physical location where the target was existing
before. Looks like a bug in this function.


I want to see it fail in that case or return something lie NONE , but it
still returns me the target path.





-----Original Message-----
From: python-win32-bounces+ayaskanta.swain=altair.com at python.org
[mailto:python-win32-bounces+ayaskanta.swain=altair.com at python.org] On
Behalf Of Tim Golden
Sent: Friday, March 04, 2011 5:30 PM
Cc: python-win32 at python.org
Subject: Re: [python-win32] How to read the target of a Windows Shortcut


On 04/03/2011 11:59, Ayaskanta Swain wrote:

> Hi,


> I want to know the target path of a windows shortcut. How do i read

> short cut & retrieve the actual target path it is pointing to? I

> searched the internet & all the documents I found there refer to use

> Win32com.shell or win32com.client module but was not satisfied with

> solutions given there.


Well I don't know if this was one of the solutions with which

you were "not satisfied", but it does at least have the merit

of working:






python-win32 mailing list

python-win32 at python.org


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20110304/59e32149/attachment.html>

More information about the python-win32 mailing list