How to get target path of Shorcut (lnk) files in VB 6
-
hi Please help me how to get the target path of windows shortcut fiels in Visual Basic Eman Ali Moughal Senior Software Engineer Soon Soft (pvt) Ltd www.soonsoft.com
-
hi Please help me how to get the target path of windows shortcut fiels in Visual Basic Eman Ali Moughal Senior Software Engineer Soon Soft (pvt) Ltd www.soonsoft.com
hi Following code will resolve the target path of a shortcut named notepad.lnk in c:\ Change the path accordingly to meet ur requirment.
Dim objFolder As Folder Dim objFolderItem As FolderItem Dim objShell As Shell Set objShell = New Shell Set objFolder = objShell.NameSpace("c:\") Set objFolderItem = objFolder.ParseName("notepad.lnk") If Not objFolderItem Is Nothing Then Dim objShellLink As ShellLinkObject Set objShellLink = objFolderItem.GetLink If Not objShellLink Is Nothing Then Debug.Print objShellLink.Path End If Set objShellLink = Nothing End If
rgds..mil10 -
hi Following code will resolve the target path of a shortcut named notepad.lnk in c:\ Change the path accordingly to meet ur requirment.
Dim objFolder As Folder Dim objFolderItem As FolderItem Dim objShell As Shell Set objShell = New Shell Set objFolder = objShell.NameSpace("c:\") Set objFolderItem = objFolder.ParseName("notepad.lnk") If Not objFolderItem Is Nothing Then Dim objShellLink As ShellLinkObject Set objShellLink = objFolderItem.GetLink If Not objShellLink Is Nothing Then Debug.Print objShellLink.Path End If Set objShellLink = Nothing End If
rgds..mil10Thnks BUddy for the code but the problem is that this code is not working in VB 6 i think this is the code for VB.NET because in VB 6 FolderItem and Shell does not Exist would you please help me in this matter Thanks Eman Ali Moughal Senior Software Engineer Soon Soft (pvt) Ltd www.soonsoft.com
-
Thnks BUddy for the code but the problem is that this code is not working in VB 6 i think this is the code for VB.NET because in VB 6 FolderItem and Shell does not Exist would you please help me in this matter Thanks Eman Ali Moughal Senior Software Engineer Soon Soft (pvt) Ltd www.soonsoft.com
hi I just came back to my desk after Easter vacation. Sorry for the delay. The code works fine with vb6. But I missed to tell u one thing. You have to give reference to
C:\WINNT\system32\shell32.dll
. Give reference to this dll and try. Rgds…mil10 -
hi I just came back to my desk after Easter vacation. Sorry for the delay. The code works fine with vb6. But I missed to tell u one thing. You have to give reference to
C:\WINNT\system32\shell32.dll
. Give reference to this dll and try. Rgds…mil10HI Thanks for the reply. But sorry to bother you again and again :) i have some problems related to the code i have added the link to Shell32.dll so the problem of variables resolve but the function are not working properly Like like SET FOLDERITEM = objShell.ParseIFle("c:\") I think this is the function , si this function is not returning the proper directory I dont know why woould you please Help me Thanks Eman Ali Moughal Senior Software Engineer Soon Soft (pvt) Ltd www.soonsoft.com
-
HI Thanks for the reply. But sorry to bother you again and again :) i have some problems related to the code i have added the link to Shell32.dll so the problem of variables resolve but the function are not working properly Like like SET FOLDERITEM = objShell.ParseIFle("c:\") I think this is the function , si this function is not returning the proper directory I dont know why woould you please Help me Thanks Eman Ali Moughal Senior Software Engineer Soon Soft (pvt) Ltd www.soonsoft.com
hi No chance for any mishap, it shud work. Just chk the export list of shell32 using object browser whether those methods are there in the specified class. I tested it on Win2k professional and works fine. rgds..mil10
-
hi No chance for any mishap, it shud work. Just chk the export list of shell32 using object browser whether those methods are there in the specified class. I tested it on Win2k professional and works fine. rgds..mil10
hi Cool man Thanks Very much the code is working too much file but with a little change i dont know why but the change is Dim objFolder As Folder2 in the deceleration section. Because in the Intellisence list their two Folder options one is FOLDER and other is FOLDER2. Folder2 option contains the procedure PARSENAME() . Any way thanks very much for the Help Eman Ali Moughal Senior Software Engineer Soon Soft (pvt) Ltd www.soonsoft.com