VB添加桌面快捷方式(也可到程序、启动)


Private Declare Function fCreateShellLink Lib “STKIT432.DLL” (ByVal lpstrFolderName As String, ByVal lpstrLinkName As String, ByVal lpstrLinkPath As String, ByVal lpstrLinkArgs As String) As Long
Sub Command1_Click()

Dim lReturn As Long

'添加到桌面
lReturn = fCreateShellLink(“..\..\Desktop”, “Shortcut to Calculator”, “c:\windows\calc.exe”, “”)
'添加到程序组
lReturn = fCreateShellLink(“”, “Shortcut to Calculator”, “c:\windows\calc.exe”, “”)
'添加到启动组
lReturn = fCreateShellLink(“\Startup”, “Shortcut to Calculator”, “c:\windows\calc.exe”, “”)

End Sub



One thought on “VB添加桌面快捷方式(也可到程序、启动)

Comments are closed.