question

RonSipherd-9808 avatar image
0 Votes"
RonSipherd-9808 asked RonSipherd-9808 edited

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

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?

dotnet-visual-basic
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @RonSipherd-9808 ,

but the online documentation for this suggests it is obsolete.

Could you provide more details about the sentence?
Besides, you can click the 80091-1.png icon to share your code.


0 Votes 0 ·
1.png (73.5 KiB)

(Would have responded sooner, but I thought this system provided notification of replies.)

https://docs.microsoft.com/en-us/previous-versions//xk6kst2k(v=vs.85)

We're no longer updating this content regularly. Check the Microsoft Product Lifecycle for information about how this product, service, technology, or API is supported.

Am unclear on how to "check the Microsoft Product Lifecycle".

0 Votes 0 ·

1 Answer

Castorix31 avatar image
0 Votes"
Castorix31 answered RonSipherd-9808 commented

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





· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks! Yes, it does seem to, but I believe it is deprecated; am looking for the current favored approach.
Will take a look at ShellLinkObject.

0 Votes 0 ·