Put an icon on all users desktop in domain

By albert001 ·
I created a script to put a shortcut on everyone's desktop like this:

Set objShell = CreateObject("Wscript.Shell")
strDesktop = objShell.SpecialFolders("Desktop")

Set objShortcut = objShell.CreateShortcut(strDesktop & "\Helpdesk.lnk")
objShortcut.TargetPath = ""

objShortcut.Description = "Creates desktop icon for helpdesk"
objShortcut.WorkingDirectory = strDesktop

objShortcut.SetIconLocation "G:\spiceworks.ico", 0


The problem is that it only puts the icon there on user profiles that have been created since I set the GPO. It is Windows Server 2003 SBS and all the desktops are XP. We are not using roaming profiles. Also the icon looks like a broken link, how do I get it to use the .ico that I want?

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

Might be easier

by LarryD4 In reply to Put an icon on all users ...

Might be easier to just write the script to copy the spiceworks.ico file from a share on a server to each PC's "All Users\Desktop" folder as they sign in.

You may want to include a check to see if its already their.

Collapse -

Set it as a logon script

by neilb@uk In reply to Put an icon on all users ...

Write it to check to see if the shortcut is already there and exit if that's the case.

This is the MS Scripting Guy's method to change an icon and it's the method that I use. Looks much the same as yours.

Const DESKTOP = &H10&

Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.NameSpace(DESKTOP)

Set objFolderItem = objFolder.ParseName("Shortcut.lnk")
Set objShortcut = objFolderItem.GetLink

objShortcut.SetIconLocation "C:\Windows\System32\SHELL32.dll", 13

Neil :)

Back to Networks Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums