Retrieve fully qualified .lnk file's target in script?

soughtValue = scriptColData.columns('target').value;

scriptColData.columns is the columns which your script has added and can fill out. You can't use it to look up the values of other columns. (It's essentially an output of your script, not an input.)

To get the target of a shortcut (.lnk file) in JScript, you can do this:

var sh = new ActiveXObject("WScript.Shell");
var sc = sh.CreateShortcut(scriptColData.item.realpath);
var targetPath = sc.TargetPath;

A fuller example can be found here:

It's also worth having a read of the Editing & Formatting Tips link above the post editor, to learn how to post code blocks and other useful things:

2022-08-10 14-07-42 Clipboard Image

1 Like