Function CrtShortcut(Myname As String)
'引用:Windows Script Host Object Model
'功能:在桌面创建快捷方式
Dim strDesktop As String
Dim objShellLink
Dim strname As String
Dim wsh As New WshShell
strname = Mid(Myname, InStrRev(Myname, "\") + 1)
strDesktop = wsh.SpecialFolders("Desktop")
Set objShellLink = wsh.CreateShortcut(strDesktop & "\" & strname & ".lnk")
objShellLink.TargetPath = Myname
objShellLink.WorkingDirectory = strDesktop
objShellLink.Save
End Function
示 例:
点击下载此附件
演 示: