2017-07-08 84 views
0

我尝试创建一个VBS安装程序,在桌面上创建Windows 10应用程序的快捷方式。然而,经过几个小时的努力,我似乎​​无法让它工作。在桌面上创建Windows 10应用程序快捷方式vbsscript

这是我目前的脚本。

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 

我想创建一个快捷方式程序的名称是“Todoist待办事项列表和任务管理器”

我认为主要的问题是目标路径。但我似乎无法找到如何指向特殊文件夹内的文件。特殊文件夹CLSID = {4234d49b-0245-4df3-b780-3893943456e1}。我如何指向该文件夹中的文件?

非常感谢提前,

问候,

里克,

+0

你在'shell:AppsFolder'之后缺少''''''。否则你[应该很好](https://stackoverflow.com/q/37171394/11683)。 – GSerg

+0

啊,非常感谢那些已经帮助我的快速回答:)!但是,它创建了应用程序文件夹的快捷方式,而不是Win 10 Store应用程序。你也许知道如何解决这个问题? – arcety

回答

0

我花了一些时间,但我终于找到了一种方法:)。

'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 
+0

如果您设法解决您的问题,请通过单击打勾来将您的答案标记为已接受。 – BoffinbraiN

相关问题