Run this on your own machine or run it as a logon script just don’t expect to run it against a remote computer.
ObjShortcut.SetIconLocation “C:\Windows\System32\SHEL元2.dll”, 13īefore getting into the details we should mention the fact that this particular script must be run locally that’s because it uses the Shell object, and the Shell object cannot be created on a remote machine. Set objFolderItem = objFolder.ParseName(“Test Shortcut.lnk”) Set objFolder = objShell.NameSpace(DESKTOP) Set objShell = CreateObject(“Shell.Application”) Hey, we said that was our motto, we didn’t say we actually followed it. And you know our motto here at Scripting Guys Central: the customer is always right. (And if you had flying toasters on top of that, well ….) But times have changed, and apparently people aren’t satisfied with their icons anymore: yours is the fourth or fifth email we’ve gotten in the past few weeks asking if we could demonstrate a way to change icons using a script. You know, the Scripting Guys (some of them, at least) are old enough to remember a time when you would never even think about changing an icon after all, back in those days having any icon at all was considered cool. Hey, Scripting Guy! How can I change the icon for an existing shortcut?