Command to run shortcuts

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Carlos
Posts: 11
Joined: 21 Feb 2015, 11:59

Command to run shortcuts

22 Feb 2015, 20:47

Hi, I use Windows 7 Pro and have tried using the send command, run command, and I'm not having any luck opening a shortcut. Is there a specific command to run (open) a shortcut? Thanks
User avatar
maestrith
Posts: 825
Joined: 16 Oct 2013, 13:52

Re: Command to run shortcuts

22 Feb 2015, 20:53

John H Wilson III 05/29/51 - 03/01/2020. You will be missed.AHK Studio OSDGUI Creator
Donations
Discord
All code is done on a 64 bit Windows 10 PC Running AutoHotkey x32
lexikos
Posts: 9690
Joined: 30 Sep 2013, 04:07
Contact:

Re: Command to run shortcuts

23 Feb 2015, 02:02

If you want to run the shortcut, as in what happens when you double click it, use Run, path\of\shortcut.lnk
Carlos
Posts: 11
Joined: 21 Feb 2015, 11:59

Re: Command to run shortcuts

23 Feb 2015, 11:11

Are you saying to add the "\of\" in the path or should it be e.g.:
Run, C:\CA's programs\iTunes.1nk
MJs
Posts: 454
Joined: 23 Sep 2014, 03:29

Re: Command to run shortcuts

23 Feb 2015, 11:57

if you're using this

Code: Select all

Run, C:\CA's programs\iTunes.1nk
then you must have had an error that you should have mentioned, the problem with the line above is that it's not a shortcut because it ends with 1nk instead of lnk (L not ONE)
so, try it with this line, given that you have an existing shortcut called C:\CA's programs\iTunes.lnk

Code: Select all

Run, C:\CA's programs\iTunes.lnk
what lexikos is saying:
just put the path of the shortcut as the first parameter in the Run command.
here is a little tip:
right click the shortcut in windows explorer holding down the shift key, that would add an item in the context menu called Copy as path, hit it, and you'd have the path copied to the clipboard, that path is what you should pass to the Run command
Carlos
Posts: 11
Joined: 21 Feb 2015, 11:59

Re: Command to run shortcuts

23 Feb 2015, 13:54

Thank you. I used the iTunes example as an expression - I had not actually tried it because I was unsure if that was a number 1 or the letter "l". Now I know and will give it a try. I also appreciate the great tip about using the shift key to get the path which I agree would be better to use as the run command. Thank you both very much. This is my second post and I am really enjoying learning this stuff.
Carlos
Posts: 11
Joined: 21 Feb 2015, 11:59

Re: Command to run shortcuts

23 Feb 2015, 16:44

Just wanted to confirm that what you recommended worked really well and i'll be able to use this a lot in the future.
JuanmaMenendez
Posts: 8
Joined: 11 Apr 2019, 18:25
Contact:

Re: Command to run shortcuts

11 Apr 2019, 19:19

I created a script very easy to configure that allow to Open, Minimize or Restore a Window Shortcut, a Window App, a Chrome App or a Chrome shortcut. It also has some other features like Error catching etc.. the code is here https://github.com/JuanmaMenendez/AutoHotkey-script-Open-Show-Apps

I hope you found it helpful 💁‍♂️⭐
sree2022
Posts: 3
Joined: 28 Aug 2022, 11:51

Re: Command to run shortcuts

14 Sep 2022, 15:24

Even after 3 years MJ's comments are useful to me. Thank you

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Chunjee, emp00, Rohwedder and 179 guests