VB创建快捷方式到桌面

VB创建快捷方式到桌面
    Dim WshShell As Object, MyShortcut As Object
    Set WshShell = CreateObject("Wscript.shell")
   
    Dim strDesktop As String
    strDesktop = WshShell.SpecialFolders("Desktop")
   
    Set MyShortcut = WshShell.CreateShortcut(strDesktop + "\我的快捷方式.lnk") '此处为快捷名称
   
    MyShortcut.TargetPath = App.Path & "\" & App.EXEName & ".exe"  '此处为源文件
   
    'MyShortcut.IconLocation '此处为快捷图标,默认为应用程序的图标
   
    MyShortcut.WorkingDirectory = App.Path  '工作目录
   
    MyShortcut.Description = "测试创建快捷方式" '备注
   
    MyShortcut.Hotkey = "ALT+CTRL+A" '此处为快捷热键
   
    MyShortcut.Save

你可能感兴趣的:(VB创建快捷方式到桌面)