固定以在Windows 8上以编程方式启动快捷方式 [英] Pin to start a shortcut on Windows 8 programmatically

查看:116
本文介绍了固定以在Windows 8上以编程方式启动快捷方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用Installshield 2011创建了一个安装程序.该安装程序在StartMenu-> Programs中创建一个快捷方式,并且在安装过程中还运行了vbscript.此VB脚本在StartMenu-> Programs中创建另一个快捷方式.

I have created an Installer using Installshield 2011. This Installer creates a shortcut in StartMenu-->Programs and it also has runs a vbscript during installation. This VB Script creates another shortcut in StartMenu-->Programs.

问题在于,由Installshield创建的快捷方式会自动固定为启动",因此在Windows 8的Metro UI上显示为平铺,但是由VBScript创建的快捷方式为未固定为启动",并且仅在在Metro UI桌面上单击所有应用".

The problem is that the shortcut created by Installshield gets automatically "pinned to Start" and hence appear as a tile on metro UI on windows 8, but the shortcut created by VBScript is "NOT pinned to start" and is visible only after clicking on "All Apps" on the Metro UI Desktop.

我可以在VBScript中进行哪些更改,以便将快捷方式固定为启动.我可以使用任何API吗?

What can I change in the VBScript so that the shortcut is pinned to start. Is there any API Which I can use?

推荐答案

我在这里没有Windows 8,因此不确定是否可以使用Windows 8,但尝试一下也不会有任何伤害:

I don't have Windows 8 here, so I'm not sure if this will work, but it won't hurt to give it a try:

Set sa   = CreateObject("Shell.Application")
Set fldr = sa.NameSpace("C:\PATH\TO\SHORTCUT\FOLDER")
Set lnk  = fldr.ParseName("SHORTCUT.lnk")
For Each verb In lnk.Verbs
  If verb.Name = "Pin to Tas&kbar" Then verb.DoIt()
Next

这篇关于固定以在Windows 8上以编程方式启动快捷方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆