Logo
English Russian German French Spanish Italian
contact usprivacy
   Support Forums
chart
• Adjust flexgrid cell
• Animation
• Centering form text
• Coffee machine
• Creating fileshares
• Creating shortcuts
• Custom buttons
• Directory browser
• Disable mouse events
• File search by ext
• File transfer
• File watcher
• Formatting flexgrid
• Get Content Type
• Get HTML source
• Get modem port
• HTTP proxy
• ipconfig
• Large file split/merge
• MAPI
• MCI Sound Player
• Menu with images
• MP3 normalizer
• Net Send
• Netstat 2000
• No duplicate entries
• Outlook Address Book
• Set font color
• Shapes
• SOAP test
• Text-to-image
• Text file viewer
• Text find/replace
• UPS component
• View NT groups
• Word template
• Writing DNS control
    • Using DNS control
• Writing SMTP control
    • Sending email
    • Mailing list
• Writing WhoIs control
    • Using WhoIs control
• View HTML source
OISV - Organization of Independent Software Vendors - Contributing Member
VB projects - Creating Desktop/Start menu shortcuts

Description: Writing the program that creates shortcut to specified application in selected Windows special folder. Select ...\Desktop to create shortcut on Desktop, select ...\Start Menu to create shortcut in Start Menu, etc.
Minimum requirements: vb5, Windows Scripting Host Object
Download: source code
Screenshot:
shortcuts.gif (3017 bytes)
Project: Standard EXE
Controls: txtPath (textbox), txtName (textbox), cmdBrowse (button), cmdCreate (button), lst (listbox), dlg (common dialog control)
Additional project references: Windows Scripting Host Object
Code:
Dim wShell As IWshShell_Class

Private Sub cmdBrowse_Click()
    dlg.FileName = "*.exe"
    dlg.ShowOpen
    txtPath = dlg.FileName
End Sub

Private Sub cmdCreate_Click()
    Dim wShortcut As IWshShortcut_Class
    If Dir(txtPath) = "" Or Trim(txtName) = "" Or lst.ListIndex = -1 Then
        MsgBox "Error"
    Else
        Set wShortcut = wShell.CreateShortcut(lst.List(lst.ListIndex) & "\" & txtName & ".lnk")
        wShortcut.TargetPath = txtPath
        wShortcut.Save
    End If
End Sub

Private Sub Form_Load()
    Dim temp
    Set wShell = New IWshShell_Class
    For Each temp In wShell.SpecialFolders
        lst.AddItem temp
    Next
End Sub

Copyright © 1996-2009 OstroSoft. All rights reserved. info@ostrosoft.com