Run .lnk file syntax help needed Topic is solved

Ask gaming related questions (AHK v1.1 and older)
Evil-e
Posts: 262
Joined: 04 Sep 2018, 11:09

Run .lnk file syntax help needed

18 Apr 2019, 08:15

I have a single game that absolutely MUST be launched from an .lnk short-cut file and from C:\ Drive. Cannot use a batch file, nor launch directly from the games executable. Run command in AHK.exe file will not launch either, but came across this:

In the Run Documents in Target-------------> https://autohotkey.com/docs/commands/Run.htm <------------- it says an .lnk file can be run via AHK.exe

I could list all the variables I have tried, but hoping someone will help me with syntax of how to properly script the following:

Run, "G:\Games\Renault\Truck Racing\Bin\Shortcut to RTR.lnk"

:morebeard:
I have a bit of experience opening and sending commands to game console and CMD.exe... just ask :)
gregster
Posts: 9023
Joined: 30 Sep 2013, 06:48

Re: Run .lnk file syntax help needed  Topic is solved

18 Apr 2019, 09:08

What is the problem/error when you use Run, "G:\Games\Renault\Truck Racing\Bin\Shortcut to RTR.lnk" ?
Have you tried the UseErrorlevel option of Run to see what is going on?

Perhaps wrong working directory? If the lnk-shortcut is working via double-click, you might have to set the working directory yourself via the second parameter of run (is there a work directory specified in the lnk-file's "Start In" parameter? Perhaps try this parameter for run. If not, try the lnk's directory or the game's directory)

Anyway, if only this specific shortcut is working and nothing else, the solution lies probably in the shortcut's properties...
Evil-e
Posts: 262
Joined: 04 Sep 2018, 11:09

Re: Run .lnk file syntax help needed

18 Apr 2019, 11:49

DUDE :D

This is crazy talk...... (got that line from some movie back in the '80's) Anyway, I just took a look at the properties of both the
original short-cut that I have always used and the new one today. They are exactly the same, say for one part

ORIGINAL short-cut that has always worked:
Target: "G:\Games\Renault\Truck Racing\Bin\RTR.exe"
Start in: "G:\Games\Renault\Truck Racing" <---- must have copied from Desktop after game install....I never do that, as I create batch files

NEW short-cut that I made today:
Target: "G:\Games\Renault\Truck Racing\Bin\RTR.exe"
Start in: "G:\Games\Renault\Truck Racing\Bin" <----- this one includes Bin and makes perfect sense, as the exe is located in that folder

AHK.exe script WORKS:
Run, "G:\Games\Renault\Truck Racing\Bin\RTR.exe" (but this file MUST be located in the "Truck Racing" and not "Bin" folder)

AHK.exe script FAILS:
Run, "G:\Games\Renault\Truck Racing\Shortcut to RTR.lnk"

AHK.exe script FAILS:
Run, "G:\Games\Renault\Truck Racing\Bin\Shortcut to RTR.lnk"

I now have the AHK.exe & batch files located in the Truck Racing folder and allow AHK.exe to launch the game and works great :dance:

Many thanks for getting me to look at the issue from a different perspective :beer:

I pronounce this issue not only resolved, but is the 9th wonder of the world :morebeard:
I have a bit of experience opening and sending commands to game console and CMD.exe... just ask :)
gregster
Posts: 9023
Joined: 30 Sep 2013, 06:48

Re: Run .lnk file syntax help needed

18 Apr 2019, 11:57

Glad that I could help! :)
And thanks for the detailed feedback - perhaps it can help someone else in the future!

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 63 guests