Windows 95 Shortcut

I need to create a shortcut to a program with a command line parameter on the Windows 95 desktop using 32 bit APIs.  

e.g shortcut commnad will be Dnaccess.exe sploge.dnc

Needs to be usable in VB4 32 bit.

LVL 18
deightonprogAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

deightonprogAuthor Commented:
Edited text of question.
0
watyCommented:
' #VBIDEUtils#************************************************************
' * Programmer Name  : Romke Soldaat
' * Web Site         : www.geocities.com/ResearchTriangle/6311/
' * E-Mail           : waty.thierry@usa.net
' * Date             : 3/05/99
' * Time             : 10:12
' **********************************************************************
' * Comments         : Adding shortcuts to the Start menu
' *
' *
' **********************************************************************

'© Copyright 1998 Romke Soldaat. All Rights Reserved.
'-------------------------------------------------------------------
'The source code described in this article, and listed in this
'module, is copyrighted material which may not be published
'in any form without explicit prior permission from the author.
'However, you are free to use the source code in your private,
'non-commercial, projects without permission. You are allowed to
'use these functions and routines in commercial products, provided
'the documentation of these products makes a reference to the
'original source. The following reference is recommended:
'-------------------------------------------------------------------
'PART OF THIS SOFTWARE IS BASED ON SOURCE CODE, ORIGINALLY
'CREATED BY ROMKE SOLDAAT (WWW.OFFICETOYS.COM), AND PUBLISHED IN
'MICROSOFT OFFICE & VISUAL BASIC FOR APPLICATIONS DEVELOPER,
'BY INFORMANT COMMUNICATIONS GROUP (WWW.INFORMANT.COM)
'----------------------------------------------------------------

Public Sub vbCreateShortcut( _
   TargetPath As String, _
   Where As String, _
   DisplayName As String, _
   Optional Hotkey As Variant, _
   Optional IconLocation As Variant, _
   Optional WindowStyle As Variant, _
   Optional WorkingDirectory As Variant)
   'This routine creates a file or internet shortcut
   Dim WSHShell As Object
   Dim MyShortcut As Object
   Dim Extension As String
   'Is it an Internet or File shortcut?
   If InStr(TargetPath, "://") Then
      Extension = ".url"
   Else
      Extension = ".lnk"
   End If
   Set WSHShell = CreateObject("WScript.Shell")
   'See if Where is a full path
   If InStr(Where, "\") = 0 Then
      'If not, assume it's a special folder
      Where = WSHShell.SpecialFolders(Where)
   End If
   'Make sure there's trailing backslash
   If Right(Where, 1) <> "\" Then Where = Where & "\"
   Set MyShortcut = WSHShell.CreateShortcut(Where & DisplayName & Extension)
   'Set shortcut object properties and save it
   With MyShortcut
      .TargetPath = TargetPath
      If Not IsMissing(Hotkey) Then .Hotkey = Hotkey
      If Not IsMissing(IconLocation) Then .IconLocation = IconLocation
      If Not IsMissing(WindowStyle) Then .WindowStyle = WindowStyle
      If Not IsMissing(WorkingDirectory) Then .WorkingDirectory = WorkingDirectory
      .Save
   End With
   Set WSHShell = Nothing

End Sub

Sub FileShortcutDemo()
   vbCreateShortcut _
      TargetPath:="C:\my documents\badges.mdb", _'''Your mdb
      Where:="C:\Windows\Start Menu", _
      DisplayName:="Testshort"'Name the shortcut what you want
   'Hotkey:="ALT+CTRL+W", _'The following are optional
   ' IconLocation:="C:.DLL,16", _
   '  WindowStyle:="3", _
   ' WorkingDirectory:="C:documents"
End Sub

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
watyCommented:
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.