by the way. here is one of the examples I could not get working. vs.net
claimed there were no errors but when I tried to compile and use I got
null pointer exception
Public Function CreateShortCutOnDesktop(ByVal userID As String, _
ByVal passWord As String) As Boolean
Try
Dim DesktopDir As String = _
CType(WshShell.SpecialFolders.Item("Desktop"), String)
Dim shortCut As IWshRuntimeLibrary.IWshShortcut
' short cut files have a .lnk extension
shortCut = CType(WshShell.CreateShortcut(DesktopDir & _
"\MyNewShortcut.lnk"), _
IWshRuntimeLibrary.IWshShortcut)
' set the shortcut properties
With shortCut
.TargetPath = _
System.Reflection.Assembly.GetExecutingAssembly.Lo cation()
.WindowStyle = 1
.Description = "Run Typist Summary"
.WorkingDirectory = DesktopDir
' the next line gets the first Icon from the executing
program
.IconLocation = _
System.Reflection.Assembly.GetExecutingAssembly.Lo cation() & _
", 0"
' the next line sets the userID and passWord into the
shortcut
' as arguments
' which will be read from the command line.
.Arguments = userID & ", " & passWord
.Save() ' save the shortcut file
End With
Return True
Catch ex As System.Exception
' add your error handling here, if any
Return False
End Try
End Function