DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: Trying to create Steam game shortcuts with AHK  (Read 13,055 times)

nite_monkey

  • Member
  • Joined in 2006
  • **
  • Posts: 753
Trying to create Steam game shortcuts with AHK
« on: April 06, 2017, 05:18 AM »
I ran across a tutorial to create shortcuts that can be pinned to the windows 10 start menu for steam games without using third party apps.
I wanted to automate this process using AutoHotKey, however when I get to the part where the script actually creates the shortcut, it creates a shortcut with a blank file location.
the file location has to be "%windir%\explorer.exe steam://rungameid/1234"
in my script, I am using
Code
FileCreateShortcut, explorer.exe steam://rungameid/%Sname%, %Gname%.lnk,,,,%IcoLoco%
which creates a shortcut with a blank file location.
Is there any way that I can get this to work? I only know how to code in AHK, so switching to a different program language isn't an option for me, because I rarely make apps, so I don't really want to learn a whole new language just for one simple app.
Any help would be greatly appreciated.
[Insert really cool signature here]

nite_monkey

  • Member
  • Joined in 2006
  • **
  • Posts: 753
Re: Trying to create Steam game shortcuts with AHK
« Reply #1 on: April 06, 2017, 05:40 AM »
Never mind, I figured it out.
Code
FileCreateShortcut, explorer.exe, %Gname%.lnk,,steam://rungameid/%Sname%,,%IcoLoco%
I had no clue what the Args option was, so I messed around with it for a bit, and figured out how to get it to work.
[Insert really cool signature here]

IainB

  • @Slartibartfarst
  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 7,544
Re: Trying to create Steam game shortcuts with AHK
« Reply #2 on: April 06, 2017, 08:40 AM »
^^ Well done and thankyou! I had exactly the same need, and you have just shown a useful solution.    :Thmbsup:

nite_monkey

  • Member
  • Joined in 2006
  • **
  • Posts: 753
Re: Trying to create Steam game shortcuts with AHK
« Reply #3 on: April 06, 2017, 10:23 AM »
yeah, it annoyed me that you couldn't pin steam games to the start menu. I pin all my apps on the start menu in labeled groups to keep my desktop organized.
here is the website with the tutorial in case you need it.

Code
InputBox, Sname, Input Steam Shortcut, Type in the gameid here.
if ErrorLevel
	ExitApp
else
	MsgBox, Next, select the icon for the shortcut.
FileSelectFile, IcoLoco
if IcoLoco =
	ExitApp
else
	InputBox, Gname, Input Game Name, Type in the game's name here.
if ErrorLevel
	ExitApp
else
FileCreateShortcut, explorer.exe, %Gname%.lnk,,steam://rungameid/%Sname%,,%IcoLoco%
and the source code for my completed script for anyone in the same boat as me.
[Insert really cool signature here]
« Last Edit: April 06, 2017, 10:31 AM by nite_monkey »

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 11,205
    • Participated in NANY Challenge Fourteen Times
    • Coding Snacks
    • Writer
    • Hardware Hacker
Re: Trying to create Steam game shortcuts with AHK
« Reply #4 on: April 06, 2017, 12:22 PM »
There's also a very simple tool by skwire to do the same.

http://www.donationcoder.com/forum/index.php?topic=26167.msg242767#msg242767

nite_monkey

  • Member
  • Joined in 2006
  • **
  • Posts: 753
Re: Trying to create Steam game shortcuts with AHK
« Reply #5 on: April 06, 2017, 02:31 PM »
There's also a very simple tool by skwire to do the same.

http://www.donationcoder.com/forum/index.php?topic=26167.msg242767#msg242767
...Well that just destroys my app. Kind of wish I looked here first. I should have known one of the awesome DC coders would have written something for this.
[Insert really cool signature here]

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
Re: Trying to create Steam game shortcuts with AHK
« Reply #6 on: April 06, 2017, 04:05 PM »
One of the hardest aspects of coding these days is finding ideas that haven't been implemented already  :mad:

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 11,205
    • Participated in NANY Challenge Fourteen Times
    • Coding Snacks
    • Writer
    • Hardware Hacker
Re: Trying to create Steam game shortcuts with AHK
« Reply #7 on: April 06, 2017, 07:56 PM »
One of the hardest aspects of coding these days is finding ideas that haven't been implemented already  :mad:

In my opinion, one of the cool things about making your own implementations, is that you can add your own tweaks.  There's also the satisfaction of doing it.  I was just pointing out that there was another one.  The advantage of your app is that you have the source, and can make adjustments, also.  Of course, the advantage of skwire's is you don't have to.  It's a tradeoff. :)

nite_monkey

  • Member
  • Joined in 2006
  • **
  • Posts: 753
Re: Trying to create Steam game shortcuts with AHK
« Reply #8 on: April 07, 2017, 09:51 AM »
One of the hardest aspects of coding these days is finding ideas that haven't been implemented already  :mad:

In my opinion, one of the cool things about making your own implementations, is that you can add your own tweaks.  There's also the satisfaction of doing it.  I was just pointing out that there was another one.  The advantage of your app is that you have the source, and can make adjustments, also.  Of course, the advantage of skwire's is you don't have to.  It's a tradeoff. :)
All excellent points. I may go back to mine and tweak it some later, but right now I am enjoying how simple and easy skwire's is.
[Insert really cool signature here]

Original address: https://www.donationcoder.com/forum/index.php?topic=43684.0