Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1485
  • Last Modified:

Pushing out desktop shortcuts using group policy

I’m looking for a way to push out a number of desktop shortcuts of local URL’s onto users desktops across a domain.  

All our clients are XP SP3.  Can someone define a simple BAT file that would accomplish this and suggest a way to apply this to group policy for all users.
0
DHPBilcare
Asked:
DHPBilcare
  • 3
1 Solution
 
dontsemeCommented:
I whould not use a bat file I would use VBScript. Like this one.  Then add it to you group ploicy
'##############################################################
'# CREATESHORTCUT_WSH.VBS
'# CREATES A SHORTCUT ON THE USERS DESKTOP TO A SPECIFIED FILE
'#
'# USES: WINDOWS SCRIPT HOST
'# LANGUAGE: VISUAL BASIC SCRIPTING EDITION
'##############################################################

'FORCE EXPLICIT VARIABLE DECLARATION
option explicit

'STEP OVER ERRORS FOR CUSTOM ERROR REPORTING
on error resume next

'DECLARE VARIABLES
dim shell, desktopPath, link, sys32Path

'INSTANTIATE THE WINDOWS SCRIPT HOST SHELL OBJECT
Set shell = WScript.CreateObject("WScript.shell")

'SET THE PATH TO THE WINDOWS DESKTOP FOLDER & MY DOCUMENTS FOLDER
desktopPath = shell.SpecialFolders("Desktop")
sys32Path = "%SystemRoot%\system32"

'CREATE A SHORTCUT ON THE USER'S DESKTOP
Set link = shell.CreateShortcut(desktopPath & "\your.url")

'SET THE PROPERTIES FOR THE SHORTCUT
link.Description = "your shortcut here"
link.TargetPath = "http://????/"
link.WindowStyle = 3
link.WorkingDirectory = desktopPath
link.Save

'CLEANUP OBJECTS
set shell = nothing

'LET THE USER KNOW IF THERE WAS AN ERROR AND WHAT IT WAS
'OTHERWISE CONFIRM SHORCUT CREATION
'if err.number <> 0 then
'      msgbox "There was an error creating your shortcut." & vbCrLf & err.description & vbCrLf & err.source, vbOKOnly-vbExclamation, "Shortcut Builder"
'else
'      msgBox "Your new shortcut has been created!" & vbCrLf & "Please check your Windows Desktop.", vbOKOnly-vbInformation, "Shortcut Builder"
'end if
0
 
DHPBilcareAuthor Commented:
Thanks for that.

How would I apply this to group policy on a Windows 2003 Server?
0
 
dontsemeCommented:
Yes if you want it to go to all I would apply it in the default domain policy. Under Local computer policy/Computer configuration/windows setting/scripts/startup
0
 
arnoldCommented:
I would add the shortcuts to the c:\documents and settings\all users\desktop.
Make sure the settings on the files is to inherit from parent.

The simple thing would be to create the shortcut and then copy them.

You could use the advice from dontseme in a startup script to copy data from a shared location to the local c:\documents and settings\all users\dektop\
0
 
dontsemeCommented:
If you did the vbs script you could either add it to the computer or user container in Group Policy. This just ensures that if you ever reimage or bring new computers on the domain they automatically get it. I use this script to push 4 urls to the desktop or 2 (different script) by putting it in the user configuration depending on who logs in. I also have various drives mapped by user this way. Just copy the vbs to a txt file and edit to suit your needs. Then save it to your DC and edit the group policy to apply the script. To me it is alot easier to do it this way for the 400+ computers in my network. Hope this helps.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now