vbscript - How to open .lnk file or better known as a shortcut

Anything VBScript-related, including Windows Script Host, WMI, ADSI, and more.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Locked
Ldallial
Posts: 1
Joined: Thu Mar 12, 2020 1:40 am
Location: Clifton
Contact:

vbscript - How to open .lnk file or better known as a shortcut

Post by Ldallial »

I simply have this

set x=createobject("wscript.shell")
x.run %comspec% /k C:\Program Files (x86)\Keysticks.net\Keysticks\KeySticks.lnk"

but gives me return code... invalid character, code: 800A0480

I copy pasted the path... I must be missing something else
:D

jvierra
Posts: 14481
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: vbscript - How to open .lnk file or better known as a shortcut

Post by jvierra »

You are missing a quote.

x.run "%comspec% /k ""%ProgramFiles(x86)%\Keysticks.net\Keysticks\KeySticks.lnk"""

Locked