How to run .lnk file?

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
LogicNg
Posts: 20
Joined: 17 Mar 2021, 05:39

How to run .lnk file?

Post by LogicNg » 04 Apr 2021, 10:12

I have a lnk file and its target isn't an exe file.
image.png
image.png (7 KiB) Viewed 890 times
I tried to create a shortcut to run it directly, I'm sure the path is correct, but it didn't work. :headwall:

Code: Select all

^h::Run ‪C:\Users\Logic\Desktop\Cambridge.lnk
That's the error ahk returned.
image.png
image.png (5.47 KiB) Viewed 890 times
Any idea?
AHK_user
Posts: 515
Joined: 04 Dec 2015, 14:52
Location: Belgium

Re: How to run .lnk file?

Post by AHK_user » 04 Apr 2021, 10:31

LogicNg
Posts: 20
Joined: 17 Mar 2021, 05:39

Re: How to run .lnk file?

Post by LogicNg » 04 Apr 2021, 10:41

@AHK_user Not what I'm looking for...
AHK_user
Posts: 515
Joined: 04 Dec 2015, 14:52
Location: Belgium

Re: How to run .lnk file?

Post by AHK_user » 04 Apr 2021, 15:47

My excuses, I misunderstood.
The code seems to be correct, only the script indicates that that lnk file does not exists, or that the file where the shortcut is pointing to, does not exists.
User avatar
jasc2v8
Posts: 59
Joined: 10 Dec 2020, 12:24
Contact:

Re: How to run .lnk file?

Post by jasc2v8 » 04 Apr 2021, 15:52

Try FileExist() to assure the file exists before the Run command.
Post Reply

Return to “Ask for Help (v2)”