Assign icon to shortcut

Hi Guys,

Is there an easy way to assign an icon to an internet shortcut for all users?

I have a url - C:\Users\Public\Desktop\example.url with the url going to say

then have an icon at c:\windows\system32\example.ico

I can set it manually by right clicking the file > properties > change icon. but onyl changes it for my profile.
Who is Participating?
Try creating a shortcut using a cscript code given below

set objShell = Wscript.Createobject("Wscript.Shell") 
strDesktopFld = objShell.SpecialFolders("Desktop") 
Set objURLShortcut = objShell.createShortcut(strDesktopFld & "\Example.lnk") 
'Name for Shortcut to add 
objURLShortcut.Targetpath = ""
'Path to icon 
objURLShortcut.IconLocation = "C:\WINDOWS\system32\shell32.dll,14" 
'Path for Shortcut 

Open in new window

TimbobalobaAuthor Commented:
that did it. thanks
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.