Solved

copy folder to each client machine

Posted on 2009-04-08
8
170 Views
Last Modified: 2012-05-06
I would like to copy a folder from a network share to all client machines on the network. Can this be done via GPO or login script.

The client machines already have a folder of the same name but the one on the share has a few changes in it. It needs only copied to the client machine once
0
Comment
Question by:QGolden
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 11

Accepted Solution

by:
xtreminator earned 100 total points
ID: 24097720
u can create batch file with following

u need following things to do....

hope u have win 2k/xp client side
Shared folder in netowrk with copy rights in newtork for all client


xcopy \\server\share /s/e/h/y client pc
0
 
LVL 31

Assisted Solution

by:Justin Owens
Justin Owens earned 300 total points
ID: 24098224
That solution will work, but it will recopy the folder every time the file is run, so if you are using GPO or Login script, you will get lots of copies performed until you remove the script.  In the scenario above, I would first create a flag file to copy to the destination computer and put it in the origination folder.  Check to see if it exists on the destination computer before you do the xcopy.  This way you will only perform the copy once rather than X number of times.
0
 
LVL 3

Assisted Solution

by:darmented
darmented earned 100 total points
ID: 24100965
I agree with DrUltima, you don't want to copy the folder every time someone logs in. I would also use the flag file to check the status of the folder via a Kix script and if it is a large folder, rather use robocopy (also via Kix) to sync the folder as apposed to copying it
0
Free eBook: Backup on AWS

Everything you need to know about backup and disaster recovery with AWS, for FREE!

 

Author Comment

by:QGolden
ID: 24145693
Is there a easy to follow tutorial on creating and setting a flag file then using xcopy?
0
 
LVL 31

Assisted Solution

by:Justin Owens
Justin Owens earned 300 total points
ID: 24147853
What language are you using to write the script?

A flag file can be anything, really... a blank text doc (with txt or flg or whatever as an extension), a uniquely named grafic , etc.

The concept is for your script to check for the existence of the file.  For example, in KIX, you could do something like the below code.

IF EXIST("C:\Program Files\Program\Flagfile.flg")
   ;do nothing
ELSE
   COPY "\\sourceserver\sourceshare\*.*" "C:\Program Files\Program\*.*" /Y
ENDIF

Open in new window

0
 

Author Comment

by:QGolden
ID: 24148033
Was maybe planning on VB I don't really know which language to use as I'm not to familiar with any.

What is KIX is it a language? It seems you first have to install it but if I write a script in VB I wouldn't have to install anything.

Is KIX better suitedfor login scripts
0
 
LVL 31

Assisted Solution

by:Justin Owens
Justin Owens earned 300 total points
ID: 24151992
VBScript below.  

KiXtart is a language that was written by MS employees to specifically make the creation and maintenance of login scripts easy in a Windows NT 4 environment.  It is sill functional in an AD environment, and (to me) is one of the easiest script languages to learn.  It does take the downloading and installation of the KiXtart program, but it is small and free.  I use a combination of KIX, VBScript, and PowerShell.

http://www.kixtart.org for more info on KIX.

dim flagFile
 
flagFile = "c:\program files\someprogram\somefile.txt"
 
If flagFile.FileExists("c:\program files\someprogram\somefile.txt") Then
   'Do Nothing because it's done
Else
	Set WshShell = WScript.CreateObject("WScript.Shell")
	'nb the trailing \ avoids the prompt asking whether target is file or directory
	wshshell.run ("xcopy sourcefolder targetfolder\ /T /E")
End If 

Open in new window

0

Featured Post

Edgartown IT Case Study

Learn about Edgartown's quest to ensure the safety and security of the entire town's employee and citizen data. Read the case study!

Question has a verified solution.

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

Suggested Solutions

Preface Having the need * to contact many different companies with different infrastructures * do remote maintenance in their network required us to implement a more flexible routing solution. As RAS, PPTP, L2TP and VPN Client connections are no…
Scenerio: You have a server running Server 2003 and have applied a retail pack of Terminal Server Licenses.  You want to change servers or your server has crashed and you need to reapply the Terminal Server Licenses. When you enter the 16-digit lic…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

738 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