Solved

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

Posted on 2014-11-10
5
223 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

Join & Write a Comment

This is a little timesaver I have been using for setting up Microsoft Small Business Server (SBS) in the simplest possible way. It may not be appropriate for every customer. However, when you get a situation where the person who owns the server is i…
Disabling the Directory Sync Service Account in Office 365 will stop directory synchronization from working.
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…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

760 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now