Solved

copy folder to each client machine

Posted on 2009-04-08
8
169 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
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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 

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 Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

I've always wanted to allow a user to have a printer no matter where they login. The steps below will show you how to achieve just that. In this Article I'll show how to deploy printers automatically with group policy and then using security fil…
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

679 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