From: Fred on 13 Apr 2010 22:05 Hi, Given a shortcut file (*.lnk) I need to find it's Target address. Can some please help me out. Thanks, Fred
From: Herfried K. Wagner [MVP] on 14 Apr 2010 08:46 Am 14.04.2010 04:05, schrieb Fred: > Given a shortcut file (*.lnk) I need to find it's Target address. Can > some please help me out. Samples <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/>
From: Onur Güzel on 14 Apr 2010 15:43 On Apr 14, 5:05 am, "Fred" <repl...(a)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
From: Fred on 14 Apr 2010 16:38 Thanks Onur and Herfried. "Onur G�zel" <kimiraikkonen85(a)gmail.com> wrote in message news:142c029e-34f4-43fd-8abe-c44770de57c6(a)c36g2000yqm.googlegroups.com... > On Apr 14, 5:05 am, "Fred" <repl...(a)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
|
Pages: 1 Prev: VB 2010 Express Next: Pausing an application waiting for a thread to finish... |