Reading .lnk files

(imported topic written by lmpymilk91)

Can we collect any information on .lnk files?

Say I want to verify all my shortcuts are pointing to the correct location.

I get a list of the .lnk files

pathnames whose (((it as lowercase contains "\quick launch\") or (it as lowercase contains "\start menu\") or (it as lowercase contains "\desktop\")) and not(it as lowercase contains "\startup\")) of descendants whose (name of it as lowercase contains "myappname.lnk") of folder "c:\documents and settings"

I now have a list of the files

c:\documents and settings\Default User\Start Menu\Programs\Accessories\MyAppName.lnk

c:\documents and settings\MyUser1\Start Menu\Programs\Accessories\MyAppName.lnk

c:\documents and settings\MyUser2\Start Menu\Programs\Accessories\MyAppName.lnk

c:\documents and settings\MyUser3\Start Menu\Programs\Accessories\MyAppName.lnk

Can I now see what exe they are pointing to? or get the icon they are using? any other information?

Thank you

chris

(imported comment written by Lee Wei)

Chris,

The file object has a property “shortcut”, which returns the “file shortcut” object. That will give you the target, icon and etc.

Something like the following?

q: (pathname of it, pathname of shortcut of it, start in pathname of shortcut of it) of descendants whose ((name of it as lowercase contains “myappname.lnk”) and ((pathname of it as lowercase contains “\quick launch”) or (pathname of it as lowercase contains “\start menu”) or (pathname of it as lowercase contains “\desktop”) and not( pathname of it as lowercase contains “\startup”) )) of folder “c:\documents and settings”

A: c:\documents and settings\lee_wei\Application Data\Microsoft\Internet Explorer\Quick Launch\MyAppName.lnk, C:\WINDOWS\notepad.exe, C:\windows

A: c:\documents and settings\lee_wei\Desktop\MyAppName.lnk, C:\WINDOWS\notepad.exe, C:\windows

Lee Wei

(imported comment written by lmpymilk91)

Lee Wei

Chris,

The file object has a property “shortcut”, which returns the “file shortcut” object. That will give you the target, icon and etc.
Something like the following?

q: (pathname of it, pathname of shortcut of it, start in pathname of shortcut of it) of descendants whose ((name of it as lowercase contains “myappname.lnk”) and ((pathname of it as lowercase contains “\quick launch”) or (pathname of it as lowercase contains “\start menu”) or (pathname of it as lowercase contains “\desktop”) and not( pathname of it as lowercase contains “\startup”) )) of folder “c:\documents and settings”

A: c:\documents and settings\lee_wei\Application Data\Microsoft\Internet Explorer\Quick Launch\MyAppName.lnk, C:\WINDOWS\notepad.exe, C:\windows
A: c:\documents and settings\lee_wei\Desktop\MyAppName.lnk, C:\WINDOWS\notepad.exe, C:\windows

Lee Wei

This is just what I was looking for.

Thank you

chris