Solved

I need to copy a shortcut to all users desktops windows 2003

Posted on 2014-11-10
5
232 Views
Last Modified: 2014-11-11
I have a shortcut to a network location that I need to copy to all users desktops in my Active Directory, however we are using Windows 2003 and I cannot use Group Policy management to do this so I would prefer to use a login script or batch file to do it instead.

so my shortcut would point to \\MYfileserver\PROJECTS

what's the best way to do this and obviously check to see if it is there already and not get stuck when running?
0
Comment
Question by:jkoutroulelis
  • 2
  • 2
5 Comments
 
LVL 6

Accepted Solution

by:
Tim Phillips earned 500 total points
ID: 40433770
I found a link that describes how to do this.  You have to write a batch file (login scripts are batch files) that creates a VB script and then runs it.

@echo off

set SCRIPT="%TEMP%\%RANDOM%-%RANDOM%-%RANDOM%-%RANDOM%.vbs"

echo Set oWS = WScript.CreateObject("WScript.Shell") >> %SCRIPT%
echo sLinkFile = "%USERPROFILE%\Desktop\myshortcut.lnk" >> %SCRIPT%
echo Set oLink = oWS.CreateShortcut(sLinkFile) >> %SCRIPT%
echo oLink.TargetPath = "D:\myfile.extension" >> %SCRIPT%
echo oLink.Save >> %SCRIPT%

cscript /nologo %SCRIPT%
del %SCRIPT%

Open in new window


http://superuser.com/questions/455364/how-to-create-a-shortcut-using-a-batch-script
0
 
LVL 13

Expert Comment

by:Rizzle
ID: 40433775
We use group policy preferences to deploy shortcuts to users desktops.

http://technet.microsoft.com/en-gb/library/cc772536.aspx

I find login scripts that tedious for such a simple task.
0
 

Author Comment

by:jkoutroulelis
ID: 40433806
I can't use group policy it's Windows 2003 and does not support GPP to do this.

that script looks nice but frankly is over my skill level to feel comfortable using, I was hoping for a simple few lines to add to the login script to simply copy the .lnk file to the users desktop

ie.

copy \\MYDOMAINCONTROLLER\PROJECTS.LNK "%userprofile%\Desktop

but I want to check first if the file is already there and not throw an error or worse make multiple copies

so something like

copy \\MYDOMAINCONTROLLER\PROJECTS.LNK "%userprofile%\Desktop
if %userprofile%\Desktop\PROJECTS.LNK exists then skip???

what syntax am I looking for here I guess is my actual question
0
 
LVL 13

Expert Comment

by:Rizzle
ID: 40433821
0
 

Author Closing Comment

by:jkoutroulelis
ID: 40434886
works but very complex
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
In-place Upgrading Dirsync to Azure AD Connect
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question