Command to run shortcuts
Command to run shortcuts
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
Re: Command to run shortcuts
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
Donations
Discord
All code is done on a 64 bit Windows 10 PC Running AutoHotkey x32
Re: Command to run shortcuts
If you want to run the shortcut, as in what happens when you double click it, use Run, path\of\shortcut.lnk
Re: Command to run shortcuts
Are you saying to add the "\of\" in the path or should it be e.g.:
Run, C:\CA's programs\iTunes.1nk
Run, C:\CA's programs\iTunes.1nk
Re: Command to run shortcuts
if you're using this
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
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
Code: Select all
Run, C:\CA's programs\iTunes.1nk
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
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
Re: Command to run shortcuts
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.
Re: Command to run shortcuts
Just wanted to confirm that what you recommended worked really well and i'll be able to use this a lot in the future.
-
- Posts: 8
- Joined: 11 Apr 2019, 18:25
- Contact:
Re: Command to run shortcuts
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
I hope you found it helpful
Re: Command to run shortcuts
Even after 3 years MJ's comments are useful to me. Thank you