How to get TargetPath from existing shortcut? 
Author Message
 How to get TargetPath from existing shortcut?

Hello Jscript Gurus!

I'm developing script to check if the shotcuts are valid.
So in that case I need first somehow to get TargetPath from already existing
shortcut.
How can I open shortcut to get this data?

I would appreciate any help or hint.
Thank you in advance.

Alexei Inozemstev.



Tue, 17 Dec 2002 03:00:00 GMT  
 How to get TargetPath from existing shortcut?
Sorry Guys,
After spending sometime exploring MSDN I figure out the solution:

var shell, shortcut, s;
shell = new ActiveXObject("WScript.Shell");
shortcut = shell.CreateShortcut("c:\\Shortcut.lnk");
s = shortcut.TargetPath;
WScript.Echo(s);
and it echos the exact path of the shortcut.
:-))))

Sorry one more time
Alexei Inozemtsev


Quote:
> Hello Jscript Gurus!

> I'm developing script to check if the shotcuts are valid.
> So in that case I need first somehow to get TargetPath from already
existing
> shortcut.
> How can I open shortcut to get this data?

> I would appreciate any help or hint.
> Thank you in advance.

> Alexei Inozemstev.




Tue, 17 Dec 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Retrieving TargetPath from existing shortcut files using VBScript

2. TargetPath problem with shortcuts that are not available to the processing machine

3. putting arguments in the TargetPath of a desktop shortcut

4. Shortcut TargetPath property?

5. Reading Target path from *existing* shortcut files.

6. View properties of an existing shortcut

7. How do you get access to an existing Desktop shortcut

8. How to get WshShortcut from existing shortcut ?

9. Edit existing shortcut

10. Using File Exists on Windows Explorer and Windows Media player shortcuts

11. Can I modify an existing shortcut?

12. Getting A Shortcut Path

 

 
Powered by phpBB® Forum Software