0

I try to create a VBS installer that creates a shortcut of a Windows 10 APP on the desktop. However after hours of trying I can't seem to make it work.

This is my current script.

With CreateObject("WScript.Shell")
    With .CreateShortcut(.SpecialFolders("Desktop") & "\Todoist To-Do List and Task Manager.lnk")
         .TargetPath = "shell:AppsFolder" & "\Todoist To-Do List and Task Manager"
         .Description = "Todoist To-Do List and Task Manager"
         .Save
    End  With
End  With

The name of the program I want to create a shortcut for is "Todoist To-Do List and Task Manager"

I think the main problem is the Target Path. But I can't seem to find out how to point to a file inside a special folder. The special folder CLSID = {4234d49b-0245-4df3-b780-3893943456e1}. How do I point to a file in that folder?

Thanks a lot in advance,

Greetings,

Rick,

rickstaa
  • 405
  • 5
  • 23
  • You're missing a ``\`` after `shell:AppsFolder`. Otherwise you [should be good](https://stackoverflow.com/q/37171394/11683). – GSerg Jul 08 '17 at 12:39
  • Ah thanks a lot for the fast answer that already helps :)! However, It creates a shortcut to the Applications folder and not to the Win 10 Store app. Do you maybe know how to solve that? – rickstaa Jul 08 '17 at 18:37

1 Answers1

0

Took me some time but I finally found a way :).

'Add AppUserModelid to AutoHotKey filesys
'Change file extension
strFile = scriptdir & "\Todoist_global_shortcuts.ahk"
WScript.Echo strFile
strRename = scriptdir & "\Todoist_global_shortcuts.txt"

If filesys.FileExists(strFile) Then
   filesys.MoveFile strFile, strRename
End If

'Create shortcut
With CreateObject("WScript.Shell")
    With .CreateShortcut(.SpecialFolders("Desktop") & "\Todoist To-Do List and Task Manager.lnk")
         .TargetPath = "shell:AppsFolder\" & pathStr
         .Description = "Todoist To-Do List and Task Manager"
         .Save
    End  With
End  With
rickstaa
  • 405
  • 5
  • 23