Solved

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

Posted on 2014-11-10
5
227 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 book by J.Peter Bruzzese, Microsoft MVP

Are you using Office 365? Trying to set up email signatures but you’re struggling with transport rules and connectors? Let renowned Microsoft MVP J.Peter Bruzzese show you how in this exclusive e-book on Office 365 email signatures. Better yet, it’s free!

Question has a verified solution.

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

INTRODUCTION The purpose of this document is to demonstrate the Installation and configuration of the Data Protection Manager product. Note that this demonstration was prepared on the basis of Windows OS is 2008 R2 and DPM 2010. DATA PROTECTI…
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 tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…
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…

895 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

11 Experts available now in Live!

Get 1:1 Help Now