Assign icon to shortcut

Posted on 2011-10-09
Last Modified: 2012-05-12
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.
Question by:Timbobaloba
    LVL 9

    Accepted Solution

    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

    LVL 1

    Author Comment

    that did it. thanks

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Wish Marketing would stop bothering you?

    Is your marketing department constantly asking for new email signature updates? Are they requesting a different design for every department? Do they need yet another banner added? Don’t let it get you down! There is an easy way to manage all of these requests...

    You might have come across a situation when you have Exchange 2013 server in two different sites (Production and DR). After adding the Database copy in ECP console it displays Database copy status unknown for the DR exchange server. Issue is strange…
    New Windows 7 Installations take days for Windows-Updates to show up and install. This can easily be fixed. I have finally decided to write an article because this seems to get asked several times a day lately. This Article and the Links apply to…
    This tutorial will give a an overview on how to deploy remote agents in Backup Exec 2012 to new servers. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as connecting to a remote Back…
    This tutorial will walk an individual through the steps necessary to install and configure the Windows Server Backup Utility. Directly connect an external storage device such as a USB drive, or CD\DVD burner: If the device is a USB drive, ensure i…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now