Solved

copy folder to each client machine

Posted on 2009-04-08
8
173 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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 

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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

by Batuhan Cetin In this article I will be guiding through the process of removing a failed DC metadata from Active Directory (hereafter, AD) using the ntdsutil tool in a Windows Server 2003 environment. These steps are not necessary in a Win…
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…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

705 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