Accessing a Windows shortcut (.lnk file) in VB 2019

Ron Sipherd 276 Reputation points
2021-03-22T03:45:11.79+00:00

I am updating an older Visual Basic program that interrogates and modifies the properties of shortcut files. The program currently uses the Windows Script Host Object Model (Interop.IWshRuntimeLibrary.dll): Imports WSH = IWshRuntimeLibrary 'Windows Script Host ... Dim myShell As WSH.WshShell = New WSH.WshShell() 'Windows Script Host Dim MyShortcut As WSH.WshShortcut but the online documentation for this suggests it is obsolete. What is the current best practice for this set of operations on shortcuts?

Developer technologies | VB
{count} votes

1 answer

Sort by: Most helpful
  1. Castorix31 90,686 Reputation points
    2021-03-22T08:27:16.743+00:00

    IWshShortcut still works fine on Windows 10
    Otherwise, another standard method is with ShellLinkObject object (Reference Shell32.dll)


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.