Page 1 of 1

script.bat: how to get the path of its shortcut script.lnk ?

Posted: 08 Oct 2008 08:16
by budhax
Hello,
Let's a .BAT file "test.bat" like:

Code: Select all

ECHO.Path of this script %~nx0: %~DP0
ECHO.Path of its Windows shortcut(.LNK): __ ?
Pause&EXIT


and its MS Windows shortcut "test.lnk" (located in another folder).
How to get the path (and file name) of this shortcut "test.lnk"
a) when double clicking on the .LNK
b) when dropping a file on this .LNK

Thanks