How to get .lnk full path when firing it with its hotkey?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Awannaknow
Posts: 78
Joined: 01 Oct 2013, 08:07

How to get .lnk full path when firing it with its hotkey?

28 Feb 2017, 10:26

EDIT:
-----------------

I forgot to Put "Global" for variables, so nothing happened when I called "msgbox, %1%" the %1% was empty.
But the pbm remain for me:
On double clicking a file/folder/shortcut the variable 1 (number one) get target full path.
But when using .lnk hotkey (.lnk keyboard shortcut), the variable 1 (number one) only get target full path.
Is it possible to get the .lnk full path? or something making possible to deduce that this shortcut action comes from this .lnk file?
-----------------
On double clicking a file/folder/shortcut the variable 1 (number one) get target full path.
But when using .lnk hotkey (.lnk keyboard shortcut), I have not found anything yet.

If I modify a .lnk "Target" to include an ahk script in it how then could I get its .lnk windows shortcut properties?
Let me explain better:
With winrar as an example, a normal unmodified shortcut
Target: C:\ ProgramFiles\WinRar\winrar.exe
Starts in: C:\ ProgramFiles\WinRar
Hotkeys: W (windows only authorize CTRL +ALT)

I plan to make a script able to get the .lnk path/name.lnk, or even target full path, when firing its .lnk hotkey.
In this case it is CTRL +ALT + W

To do it, I'll "intercept" the shortcut normal behavior by including my script in it's target path.
Changing the Target to (as an example):
C:\AutoHotkey\AutoHotkey.exe "C:\AutoHotkey\MyScripts\Get_LNK_Full_Path.ahk" "C:\ ProgramFiles\WinRar\winrar.exe "
Starts in: C:\ ProgramFiles\WinRar
Hotkeys: W (windows only authorize CTRL +ALT)

And when firing the shortcut with its hotkey, the script (Get_LNK_Full_Path.ahk) get the .lnk path (or any infos that I could use to detect which .lnk it is, like target full path) and let the .lnk act normally.

It is to use on many .lnk files.
It has to be usable on many "modified" .lnk files pointing to this single hypothetical Get_LNK_Full_Path.ahk file which will handle the task.
Any help appreciated.
Thanks in advance.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: OrangeCat, pgeugene, sanmaodo, zerox and 301 guests