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

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
budhax
Posts: 63
Joined: 09 Oct 2006 12:25

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

#1 Post by budhax » 08 Oct 2008 08:16

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

Post Reply