Highlights
All Snippets
Top 100 Snippets
Librarians
gbCodeLib

By Language
VB6
JavaScript
Perl
HTML
SQL
Java
DOS

GBIC >> Source Code >> Visual Basic >> Snippet

Create a shortcut to your app in any folder


'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