Create A Windows Shortcut With 9 Lines Of Code
A Function To Create Windows Shorcut .URL for hyperlinks .LNK for anything else There are many other variables that can be implemented besides just Name where it points hotkey and description
AI
AI Summary: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.
Source Code
Public Function CreateShortcut(ShortName As String, PointsTo As String, Optional HotKey As String = "", Optional Description As String = "")
Dim WS As Object, SC As Object
Set WS = CreateObject("Wscript.Shell")
Set SC = WS.CreateShortcut(ShortName)
SC.TargetPath = PointsTo
SC.HotKey = HotKey
SC.Description = Description
SC.Save
End Function
Original Comments (3)
Recovered from Wayback Machine