Question Locked

Put an icon on all users desktop in domain

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

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 = "http://192.168.1.131/helpdesk"

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

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

objShortcut.Save

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?

3 replies

by larryd4

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.

by Member 25348569

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
objShortcut.Save

Neil :)

This discussion is closed to new replies.