读书人

VBS建立快捷方式的有关问题

发布时间: 2012-02-07 17:45:36 作者: rapoo

VBS建立快捷方式的问题
刚用VBS建立桌面快捷方式,在路径方面搞了半天还没搞定,恳求高手帮忙。

因为我的路径中包含空格,如果路径这里这样写:

oShellLink.TargetPath = "d:\Internet Explorer\iexplore.exe"

那么属性的目标位置则会在两头加上引号:"D:\Internet Explorer\iexplore.exe"

如果我想让属性的目标位置是 "D:\Internet Explorer\iexplore.exe" www.123.com 这样的,路径那里应该怎么写?

PS:下面这样写是无效的:

oShellLink.TargetPath = "d:\Internet Explorer\iexplore.exe www.123.com"


[解决办法]

VBScript code
set WshShell = WScript.CreateObject("WScript.Shell")set oShellLink = WshShell.CreateShortcut("D:\ShortcutScript.lnk")oShellLink.TargetPath = "C:\Program Files\Internet Explorer\iexplore.exe"oShellLink.Arguments = "http://www.123.com"oShellLink.Description = "Shortcut Script"oShellLink.Save 

读书人网 >vbScript

热点推荐