Solved

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

Posted on 2011-03-03
8
854 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
[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 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
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.

 
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

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

If your business is like most, chances are you still need to maintain a fax infrastructure for your staff. It’s hard to believe that a communication technology that was thriving in the mid-80s could still be an essential part of your team’s modern I…
During and after that shift to cloud, one area that still poses a struggle for many organizations is what to do with their department file shares.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

688 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