Solved

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

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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

Suggested Solutions

Title # Comments Views Activity
Active Directory Automation 8 63
upgrade exchange 2013 CU7 to CU15 9 55
BgInfo help 5 57
DNS/WINS in a domain 10 37
Issue: One Windows 2008 R2 64bit server on the network unable to connect to a buffalo Device (Linkstation) with firmware version 1.56. There are a total of four servers on the network this being one of them. Troubleshooting Steps: Connect via h…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
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…

685 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