|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Shortcut targetHi,
Given a shortcut file (*.lnk) I need to find it's Target address. Can some please help me out. Thanks, Fred Am 14.04.2010 04:05, schrieb Fred:
> Given a shortcut file (*.lnk) I need to find it's Target address. Can Samples> some please help me out. <URL:http://www.msjogren.net/dotnet/eng/samples/dotnet_shelllink.asp> -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://dotnet.mvps.org/dotnet/faqs/> On Apr 14, 5:05 am, "Fred" <repl...@newsgroup.please> wrote: Add a reference to "Windows Script Host Object Model" through COM tab> Hi, > > Given a shortcut file (*.lnk) I need to find it's Target address. > Can some please help me out. > > Thanks, > Fred in "Add Reference" dialog. Then pass the necessary .lnk location to find its target path as follows: '------------------------- Start------------------------------------------------------ Dim shortCut As IWshRuntimeLibrary.IWshShortcut shortCut = CType((New IWshRuntimeLibrary.WshShell).CreateShortcut _ ("c:\shortcut_here.lnk"), _ IWshRuntimeLibrary.IWshShortcut) ' Get target path in messagebox MsgBox(shortCut.TargetPath) '------------------------- End------------------------------------------------------ HTH, Onur Güzel Thanks Onur and Herfried.
Show quoteHide quote "Onur Güzel" <kimiraikkone***@gmail.com> wrote in message news:142c029e-34f4-43fd-8abe-c44770de57c6@c36g2000yqm.googlegroups.com... > On Apr 14, 5:05 am, "Fred" <repl...@newsgroup.please> wrote: >> Hi, >> >> Given a shortcut file (*.lnk) I need to find it's Target address. >> Can some please help me out. >> >> Thanks, >> Fred > > Add a reference to "Windows Script Host Object Model" through COM tab > in "Add Reference" dialog. > > Then pass the necessary .lnk location to find its target path as > follows: > > '------------------------- > Start------------------------------------------------------ > Dim shortCut As IWshRuntimeLibrary.IWshShortcut > shortCut = CType((New IWshRuntimeLibrary.WshShell).CreateShortcut _ > ("c:\shortcut_here.lnk"), _ > IWshRuntimeLibrary.IWshShortcut) > > ' Get target path in messagebox > MsgBox(shortCut.TargetPath) > '------------------------- > End------------------------------------------------------ > > HTH, > > Onur Güzel |
|||||||||||||||||||||||