Quick References
ADO
ASP
CSS2
HTML
JavaScript
Jet SQL
VBScript
WML
WMLScript
WSH
XHTML
XML DOM
XSLT
Features
Knowledge Base
Tutorials
Partners
ZVON.ORG
XML
Planet Source Code
VisualBuilder
Web Design
Your HTML Source
XML/XSLT Forums
ASPAlliance
Scripts
Programmers Heaven
Tek-Tips Forums
Developer Fusion
Code Project
All Properties
Property: WshShortcut.IconLocation
object.
IconLocation
The
IconLocation
property sets or retrieves a String that is the location of the icon used to represent the shortcut. The string is of the form "path,index", where path is the full path to the file containing the icon, and index is the zero-based index of the icon within the specified icon file.
Specifying an invalid value for this property will not cause an error. However, the icon that will be displayed for the shortcut may be changed. Setting this property to the empty string restores the shortcut's default icon.
The following JScript code sets the icon for a shortcut called "Shortcut to Test.vbs.lnk" to the 4th icon (since the icons are zero-indexed) in the shell32.dll file.
Code:
objShell = WScript.CreateObject("WScript.Shell")
objShtCut = objShell.CreateShortcut
("C:\\Documents And Settings\\DevGuru\\Desktop\\Shortcut To Test.vbs.lnk") objShtCut.IconLocation = "C:\\winnt\\system32\\shell32.dll,3"
objShtCut.Save()
WScript.Echo(objShtCut.IconLocation)
Output:
C:\WINNT\system32\shell32.dll,3
Copyright 1999-2005 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information