Solved

how to automatically copy files from network computers to server (xcopy)

Posted on 2011-03-03
8
850 Views
Last Modified: 2012-05-11
We are running a small network with four computers. Some of our employees often forget to save the files to a certain folder that they are assigned to which is linked to our server(share folder). Recently one of our computer crashed and we lost some files because those were saved on desktop and not to the share folder.So is there any way we can get any software or anything that will automatically copy files from every user profiles and copy it to our server.

I am trying the xcopy option but unable to get it work.


xcopy C:\Documents and Settings\My Documents\network computername\network name\destination folder on server/drive name
Please let me know if i am doing anything wrong here. Also let me know how to run it,as after creating name.bat file it does not run.

0
Comment
Question by:shahedny
8 Comments
 
LVL 6

Expert Comment

by:rnicolaus
ID: 35031352
First make sure you have a drive mapped to the destination (I'm using Z in the example).  Then run the command with these switches:

xcopy c:\(your date source path)\  Z:\(user path)\ /M /S /E /C /I /R /Y

M = Only copies files with Archive bit on & sets Archive bit off
S = Includes subdirectories
E =  Includes subdirectories incl. empty ones
C = Continues even with errors
I = If destination does not exist and more than 1 file assumes it's a directory
R = Overwrites existing read only files
Y = Overwrites existing files and supresses the "Y" usually needed to confirm

You may want to only include files that have change or are new.  In that case you need to use the /M which copies only the ones that have the Archive attribute set, then turns it off after it copies.  This way you cut down on the network traffic and time it takes to run this script.
0
 
LVL 6

Expert Comment

by:rnicolaus
ID: 35031381
I forgot to add - Firstly run this version without the M

xcopy c:\(your date source path)\  Z:\(user path)\  /S /E /C /I /R /Y
0
 

Author Comment

by:shahedny
ID: 35031493
can you give me the exact code for that please:
copy my documents and desktop files from computer frontright to  abcserver  network abc drive D folder frontright
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
LVL 6

Expert Comment

by:rnicolaus
ID: 35031525
Well, I would need your paths:  

Desktop Windows version, Username, etc.

Server folder drive mapped letter and folder that user has access to.
0
 

Author Comment

by:shahedny
ID: 35031585
network computers are running on xp. name of the computer is frontright.(need to copy all the my documents files together with the desktop files) to the server. Network name is PVEST . Server name is pvserver. Destination folder is frontright located at D drive of the server.
0
 
LVL 6

Accepted Solution

by:
rnicolaus earned 300 total points
ID: 35031665
From what I can determine, here's the batch file:
----------------------------
net use z: /delete
net use z: \\pvserver\d$
xcopy "c:\documents and settings\PVEST\My Documents\"  Z:\frontright\ /M /S /E /C /I /R /Y
xcopy "c:\documents and settings\PVEST\Desktop\"  Z:\frontright\ /M /S /E /C /I /R /Y
-------------------

 (<<The d$ may need to be changed to a shared folder name with user PVEST allowed to read/write/delete>>)

This is the 'first run' batch file without the /M switch
----------------------------
net use z: /delete
net use z: \\pvserver\d$
xcopy "c:\documents and settings\PVEST\My Documents\"  Z:\frontright\ /S /E /C /I /R /Y
xcopy "c:\documents and settings\PVEST\Desktop\"  Z:\frontright\ /S /E /C /I /R /Y
-------------------


 
0
 
LVL 63

Assisted Solution

by:SysExpert
SysExpert earned 200 total points
ID: 35031757
Other options.

MS has the free Sync Toy V

Free MS tool ; SyncToy v2.0 Sync Toy v2.0 synch toy
http://www.microsoft.com/downloads/details.aspx?familyid=C26EFA36-98E0-4EE9-A7C5-98D0592D8C52&displaylang=en

has automated syncing.

I hope this helps !
0
 
LVL 12

Expert Comment

by:Dave
ID: 35032743
I use robocopy from the rkkit tools (do a google search for robocopy download) but xcopy is OK.

use the environment variables to build the strings

so

xcopy /s %userprofile%\my documents\*.* \\servername\sharename\

0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Let’s list some of the technologies that enable smooth teleworking. 
Don’t let your business fall victim to the coming apocalypse – use our Survival Guide for the Fax Apocalypse to identify the risks and signs of zombie fax activities at your business.
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…

777 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