I needed my program to follow a possible shortcut .lnk redirection, and was pleased to find that Winbatch has my back with the
ShortCutInfo function:
;=== address the possibility that param1 is actually a Windows "shortcut" file ===
errormode(@off)
scinfo = shortcutinfo(param1) ; attempt to interpret as a "shortcut"
errormode(@on)
if itemcount(scinfo,@tab)>1 ; is a list?
display(1,"shortcut redirecting From",param1)
param1 = itemextract(1,scinfo,@tab) ; 1st element is target filename
display(2,"shortcut redirecting To",param1)
endif