why can’t we copy path of target from .lnk shortcut. I tried with following script doesnt work. If we look at the shortcut properties it shows the path just wont let copy it.

CreateShortcut Method

var WshShell = new ActiveXObject("WScript.Shell");
strDesktop = WshShell.SpecialFolders("Desktop");
var oShellLink = WshShell.CreateShortcut("C:\Documents and Settings\user1\Desktop\to haven.lnk");

sysinternals strings came to rescue.

C:\> strings "C:\Documents and Settings\user1\Desktop\to haven.lnk"

prints the target path.

Shell Links


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s