I'm trying to read the target file/directory of a shortcut (.lnk
) file from Python. Is there a headache-free way to do it? The spec is way over my head.
I don't mind using Windows-only APIs.
My ultimate goal is to find the "(My) Videos"
folder on Windows XP and Vista. On XP, by default, it's at %HOMEPATH%My DocumentsMy Videos
, and on Vista it's %HOMEPATH%Videos
. However, the user can relocate this folder. In the case, the %HOMEPATH%Videos
folder ceases to exists and is replaced by %HOMEPATH%Videos.lnk
which points to the new "My Videos"
folder. And I want its absolute location.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…