@
echo OFF
SET Shortcut=%~1
ECHO SET WshShell = WScript.CreateObject("WScript.Shell")>DecodeShortCut.vbs
ECHO SET Lnk = WshShell.CreateShortcut(WScript.Arguments.Unnamed(0))>>DecodeShortCut.vbs
ECHO wscript.Echo Lnk.TargetPath>>DecodeShortCut.vbs
SET vbscript=cscript //nologo DecodeShortCut.vbs
for /f "delims=" %%T in ( ' %vbscript% "%Shortcut%" ' ) do set target=%%T
DEL DecodeShortCut.vbs
ECHO Shortcut: %shortcut%
ECHO Target: %target%
I forget where I got this from, but it has to date been the easiest way to do this from command prompt, if you don't want it to be a batch file and prefer vbs, I'm sure you can parse the vbs which is just piped to a temp file and deleted afterwards to get the desired result.
Works fine on shortcuts (.lnk files) to files as well as folders.