Example scripts and tips (replaces Old Scripts & Tips archive)
Moderators: JRL, Dorian (MJT support), Phil Pendlebury
-
Grovkillen
- Automation Wizard
- Posts: 1132
- Joined: Fri Aug 10, 2012 2:38 pm
- Location: Bräcke, Sweden
-
Contact:
Post
by Grovkillen » Wed Dec 02, 2020 12:54 pm
Code: Select all
Let>SHORTCUT_FILE=C:\...\<file>.lnk
VBSTART
Function GetTargetFile(LinkFile)
Set WShell = CreateObject("WScript.Shell")
Set objShortcut = WShell.CreateShortcut(LinkFile)
GetTargetFile = objShortcut.TargetPath
End Function
VBEND
VBEval>GetTargetFile("%SHORTCUT_FILE%"),TARGET_FILE
Trick found here:
https://www.robvanderwoude.com/vbstech_shortcuts.php