Adding Desktop shortcut and Icon using a GPO logon script

Status
Not open for further replies.

crphgoldstein

Distinguished
Feb 3, 2010
1
0
18,510
Hi,
I need to add a short cut with a specific icon to user's desktops.
I created a simple batch file and placed it in a GPO under the computers configuration scripts/startup.
The shortcut I needed was already in the users IE favorites. I copied the shortcut and placed it in the netlogon share for the domain.
the batch file is this:If Not Exist "C:\Documents and Settings\All Users\Desktop\Quantros.url" copy \\Mydomain\netlogon\Quantros.url"c:\Documents and settings\All users\Desktop"
The short cut get's copied to all desktops, I've tested that and it works. When I log into a workstation with an account that has administrative privileges, the correct icon is associated with the short cut. when I log in with a regular user account, the short cut is there, and it takes me to the correct url, but it just has a generic IE icon associated with the short cut.
I've checked the permissions on the All Users Profile and all users have read read/execute permissions.
Does anyone have any idea as to why this is happening. I'm pretty sure it's got to be a permissions issue, when I add the regular user account to the local admin group on the workstation, the correct icon appears, I need to have the correct icon without giving all users admin rights to the workstations.
Thanks
 

js1510

Distinguished
May 20, 2010
2
0
18,510
Were you ever able to figure this out? I am having the same problem. I have tried copying the .ico file to the users computer and then copying the shortcut. The shortcut appears as the generic "E" and not the customized icon i want.
 

abaxter

Distinguished
Nov 29, 2011
2
0
18,510

I am having the same issue. Did anyone find anything out?
 

js1510

Distinguished
May 20, 2010
2
0
18,510
'This Script will place a shortcut on a user's desktop
'and change the Icon File associated with the shortcut

set objFSO=CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("WScript.Shell")
sUserProfile=CreateObject("WScript.Shell").ExpandEnvironmentStrings("%UserProfile%\")
sUserDesktop = objShell.SpecialFolders("Desktop")

'Modify Variables in this section
IconSourceFile= "\\SERVER\netlogon\ICONFILE.ico" 'Source file for display icon
IconFolder=sUserProfile & "\Icons\" 'Folder that the IconSourceFile will be copied to (c:\documents and settings\%username%\ICONS)
IconFile= "ICONFILE.ico" 'Icon File Name (to be saved on local computer)
ShortcutName= "\SHORTCUT NAME.lnk" 'Name of the Shortcut to appear on Desktop
URL= "http://WWW.GOOGLE.COM" 'URL/Webaddress

IF NOT objFSO.FileExists (IconFolder & IconFile) Then
IF NOT objFSO.FolderExists (IconFolder) Then
objFSO.CreateFolder (IconFolder)
End if
objFSO.CopyFile IconSourceFile, IconFolder, TRUE
End If
Set objShortcutUrl = objShell.CreateShortcut(sUserDesktop & ShortcutName)
objShortcutUrl.TargetPath = URL
objShortcutUrl.IconLocation = IconFolder & IconFile
objShortcutUrl.Save
wscript.quit()
 
Status
Not open for further replies.