Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB Script for Setting shortcut and changing icon

Status
Not open for further replies.

bcancel

IS-IT--Management
Aug 21, 2009
1
US
Hello all, hopefully someone can help me out. I am trying to write a vb script to place a shortcut for our email program url on all users desktop and change the icon form the IE to something custom. I can get the shortcut to wrok ok, but cannot get the link image to change. I created an icon using an eval version of microangelo and saved it to a shared folder.
**********************************************************

'Four parameters surlshortcutname, stargetpath, iconindex, iconfile

surlshortcutname="Email" 'without extension
stargetpath="
'To use default, set these 2 variables to null (either one will do)
'If use existing setting, set them to empty string or comment them out (either one will do)

iconindex=0
iconfile="\\mydomain.com\share\sharefolder\icons\email.ico"

set wshshell=createobject("wscript.shell")
sDesktop=wshshell.specialfolders("Desktop")
set ourllink=wshshell.createshortcut(sDesktop & "\" & surlshortcutname & ".url")
ourllink.targetpath=stargetpath
ourllink.save

***********************************************************

Any help???

Thanks

Bill
 
Place your icon file somewhere visible to everyone and use the IconLocation property.

Code:
oUrllLink.IconLocation = "\\server\share\IconFile.ico, 0

Jeff
[small][purple]It's never too early to begin preparing for [/purple]International Talk Like a Pirate Day
"The software I buy sucks, The software I write sucks. It's time to give up and have a beer..." - Me[/small]
 
Oops.
Code:
oUrllLink.IconLocation = "\\server\share\IconFile.ico, 0"

Jeff
[small][purple]It's never too early to begin preparing for [/purple]International Talk Like a Pirate Day
"The software I buy sucks, The software I write sucks. It's time to give up and have a beer..." - Me[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top