Page 1 of 1

Run .lnk file syntax help needed

Posted: 18 Apr 2019, 08:15
by Evil-e
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-------------> <------------- 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"


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

Posted: 18 Apr 2019, 09:08
by gregster
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...

Re: Run .lnk file syntax help needed

Posted: 18 Apr 2019, 11:49
by Evil-e

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:

Re: Run .lnk file syntax help needed

Posted: 18 Apr 2019, 11:57
by gregster
Glad that I could help! :)
And thanks for the detailed feedback - perhaps it can help someone else in the future!