• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 177
  • Last Modified:

copy folder to each client machine

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
QGolden
Asked:
QGolden
5 Solutions
 
xtreminatorCommented:
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
 
Justin OwensITIL Problem ManagerCommented:
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
 
darmentedCommented:
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
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 
QGoldenAuthor Commented:
Is there a easy to follow tutorial on creating and setting a flag file then using xcopy?
0
 
Justin OwensITIL Problem ManagerCommented:
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
 
QGoldenAuthor Commented:
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
 
Justin OwensITIL Problem ManagerCommented:
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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now