我试图让下面的脚本生成这样的快捷方式:
"C:\ Program Files\Internet Explorer\iexplore.exe" http://WebApp/index.aspx
set WshShell = WScript.CreateObject("WScript.Shell") strDesktop = WshShell.SpecialFolders("Desktop") set oUrlLink = WshShell.CreateShortcut(strDesktop & "\WebApp.url") oUrlLink.TargetPath = ""&chr(34)& _ "C:\Program Files\Internet Explorer\iexplore.exe" & _ chr(34)&" http://WebApp/index.aspx" oUrlLink.Save
但它似乎不喜欢报价.
我在URL中收到无效语法:""C:\ Program Files\Internet Explorer\iexplore.exe" http://WebApp/index.aspx ".
我如何嵌入"没有vbscript将其短裤打结?
根据微软的说法:
Set objShell = CreateObject("Wscript.Shell") strFolder = objShell.SpecialFolders.Item("Desktop") Set objShortcut = objShell.CreateShortcut(strFolder & "\Open Web Site.lnk") objShortcut.TargetPath = "C:\Program Files\Internet Explorer\iexplore.exe" objShortcut.Arguments = "http://WebApp/index.aspx" objShortcut.Save
您必须使用.lnk作为文件扩展名,而不是.url,因为.Arguments属性仅适用于.lnk