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

x
?
Solved

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

Posted on 2014-11-10
5
Medium Priority
?
252 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 1500 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Group policies can be applied selectively to specific devices with the help of groups. Utilising this, it is possible to phase-in group policies, over a period of time, by randomly adding non-members user or computers at a set interval, to a group f…
Let's recap what we learned from yesterday's Skyport Systems webinar.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Suggested Courses

963 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