how to get path,file name from shortcut lnk file,help 
Author Message
 how to get path,file name from shortcut lnk file,help

Before opening a file I have to find out its name and location, because in
some cases the user selects a shortcut file (*.lnk) instead of the data file
itself.

When I fire the Open statement with the *.lnk filename I don't get the
target file opened but the shortcut only.

Is there some kind of "indirect open" statement, solving the shortcut? Or is
there an API to solve the shortcut, i.e. with the lnk filename as an
argument and returning the target filename?

Somewhere I found a format description of "The Windows Shortcut File Format
as reverse-engineered by Jesse Hager" which I will use if there is no easier
way.

Paul
please email me



Thu, 25 Jul 2002 03:00:00 GMT  
 how to get path,file name from shortcut lnk file,help
I recall seeing the answer to this at http://www.mvps.org/vbnet/

Has lots of good stuff.
-Drew

Quote:

> Before opening a file I have to find out its name and location, because in
> some cases the user selects a shortcut file (*.lnk) instead of the data file
> itself.

> When I fire the Open statement with the *.lnk filename I don't get the
> target file opened but the shortcut only.

> Is there some kind of "indirect open" statement, solving the shortcut? Or is
> there an API to solve the shortcut, i.e. with the lnk filename as an
> argument and returning the target filename?

> Somewhere I found a format description of "The Windows Shortcut File Format
> as reverse-engineered by Jesse Hager" which I will use if there is no easier
> way.

> Paul
> please email me



Fri, 26 Jul 2002 03:00:00 GMT  
 how to get path,file name from shortcut lnk file,help


Quote:
> Before opening a file I have to find out its name and location, because in
> some cases the user selects a shortcut file (*.lnk) instead of the data
file
> itself.

> When I fire the Open statement with the *.lnk filename I don't get the
> target file opened but the shortcut only.

> Is there some kind of "indirect open" statement, solving the shortcut? Or
is
> there an API to solve the shortcut, i.e. with the lnk filename as an
> argument and returning the target filename?

> Somewhere I found a format description of "The Windows Shortcut File
Format
> as reverse-engineered by Jesse Hager" which I will use if there is no
easier
> way.

Are you using the Common Dialog Control? If so, IIRC, there is a property
called DereferenceShellLinks which will do this for you.

HTH
Stephen



Sun, 28 Jul 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Getting info about windows shortcut (*.LNK file)

2. Help: Resolve .lnk (shortcut) files

3. Help: Resolve .lnk (shortcut) files

4. Help Shortcuts & LNK files

5. Getting the file&path from a win shortcut

6. getting file&path from win shortcut

7. getting file&path from win shortcut

8. Getting DOS 8.3 path from Windows long file name

9. Getting a File's name and Path

10. Getting the path or file name of running application

11. Getting short file name from long file name:

12. Getting a File's Dos Name and Path

 

 
Powered by phpBB® Forum Software