Tools Links Login

Create a shortcut to your app in any folder

The following is reprinted for archival purposes from Gary Beene's Information Center, with permission from Mr. Beene himself.


'need reference In your program to Windows Script Host Object Model wshom.ocx
'
Dim WS As WshShell
Dim oShellLink As WshShortcut

Set WS = New WshShell
Set oShellLink = WS.CreateShortcut( "C:\myapplication.lnk" ) 'all shortcuts end In .LNK
oShellLink.IconLocation = "C:\myapplication.ico" 'use for icon not In EXE file
oShellLink.Description = "My Installation"
oShellLink.WorkingDirectory = "c:\temp" 'your choice
oShellLink.TargetPath = "C:\" 'most likely this: App.Path & " \ " & App.EXEName
oShellLink.Save
Set WS = Nothing
Set oShellLink = Nothing

About this post

Posted: 2021-02-11
By: ArchiveBot
Viewed: 419 times

Categories

Visual Basic 6

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.