We help IT Professionals succeed at work.

Deploying a Desktop ShortCut Through Windows policies

luciliacoelho used Ask the Experts™
I have an issue with the creation of a desktop shortcut for my users. I would like that the shortcut (poiting to a VFPro application) could be created if it doesn't exist in the client desktop whenever he logs on to the system.
Although I have set up a Secuity Group policy to do it. It's not working
Can anyone give me a hand solving this? What have i done wrong?
I send an attachment with the policy definition. The shortcut exists inthe Domain administrator desktop profile.
I have tried this policy, once and with the first user the tip has worked but afterwards it never worked again.

Kind regards GPO-2nd-screen-shot.pdf
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
1. On the Server type: "gpupdate /force" without quotes. You don't need to log out.

2. On the client side type the same command, "gpupdate /force", click yes to logout/restart workstation.

3. Check your client's (XP or Win 7) event viewer System logs.

Let us know what you find out.


Hello again.
After running the commmand  "gpupdate /force", both in the server and in the client computer I received a successfull update message. After had logged out and login on the client computer, The desktop shortcut wasn't deployed. The System Event Viewer states that Group Policy 1 and Goup Policy 2 have been correctly executed.
Is there anything else i can do?

Why not using the login script? If you are using KIX for instance there are many ways. Also if you're just using a cmd or bat file you can use it for calling a sib batchfile or out it in the loginscript.

If exist ... else ...


The issue is that I can't find a variable that allows me to address the client computer desktop in a unattended way
Kind regards


Another thing and if the customer goes to another computer what will be is desktop address.?
there is a user name on each desktop. What is the variable where I can access the windows username.
Kind regards
You could copy the shortcut to the all users desktop (C:\Documents and Settings\All Users\Desktop), so it will be available for all users or you can use a parameter like %userprofile%\Desktop. The "if exist" command checks if the file (shortcut) exists and if not it will be copied by the "else" command. This wil also be the case on a different system, because the logonscript will be run on that system as well. If for some reason the user would delete the shortcut it will be copied again on the next login.

Create somthing like ( If exist %userprofile%\Desktop\\shortcut goto end else xcopy \\location of shortcut\shortcut %userprofile%\desktop ).

If you are formiliar with VB you also could use a VB script wich does the copyjob for you and can be run with elevated rights. You can add this for instance on the Scrips (Startup/Shutdown) section under the Windows Settings under Computer Configuration with GP Manager.


Meultje thanks for your help but i'm using a windows 2003 SBS in portuguese where
Desktop is writen "Ambiente de Trabalho" (of course without quotes) so
the complete path would be someting like "C:\Documents and Settings\All Users\Ambiente de trabalho>"; whenever the commands reach a space they assume that we're issuing the wrong number of parameters. So far I couldn't publish the desktop icon. The windows shared drive works ok. but not the desktop shortcut publishing.

When spaces are used use quotations like you typed just now. That should do the trick.


Actually they don't I thought so too.
Here is the script copy (between the asterisc lines), I'm testing it within a command processor window in the SBS server i'm working with
@ echo off
rem set up desktop shortcut

cd "c:\Documents and Settings\%USERNAME%\Ambiente de Trabalho"
If exist CliniCarePEM.lnk goto end else  copy "w:\_outros\CliniCare.lnk" "c:\Documents and Settings\%USERNAME%\Ambiente de Trabalho"

exit 0

Perhaps you can copy the shortcut from the Domain admin's desktop to the netlogon dir on de domain controller (probabely de SBS also). That has normaly read access for all domain users.

I have don the following and tested it. Should work for you too..

I copied the lnk-file to the netlogon dir of the domain, in your case "\\corp.CENTIMEDIC.pt\netlogon\CliniCare.lnk". Created a batchfile (copyjob.bat) in the netlogon dir and added a call for that batchfile in de logonscript "call \\corp.CENTIMEDIC.pt\netlogon\copyjob.bat" (without quotations).

The copyjob.bat contains the following:

@echo off
rem copy shortcut to users desktop

If exist "%userprofile%\desktop\CliniCare.lnk" goto end
copy "\\corp.CENTIMEDIC.pt\netlogon\CliniCare.lnk" "%userprofile%\CliniCare.lnk"

Hope this works for you..

See that I left out de subfolder "desktop" (in your case and in your case "Ambiente de Trabalho") when copying...

copy "\\corp.CENTIMEDIC.pt\netlogon\CliniCare.lnk" "%userprofile%\CliniCare.lnk" should be
copy "\\corp.CENTIMEDIC.pt\netlogon\CliniCare.lnk" "%userprofile%\desktop\CliniCare.lnk"

 (in your case:

@echo off
rem copy shortcut to users desktop

If exist "%userprofile%\Ambiente de Trabalho\CliniCare.lnk" goto end
copy "\\corp.CENTIMEDIC.pt\netlogon\CliniCare.lnk" "%userprofile%\Ambiente de Trabalho\CliniCare.lnk"