Solved

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

Posted on 2011-03-03
8
847 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
 
LVL 6

Expert Comment

by:rnicolaus
Comment Utility
Well, I would need your paths:  

Desktop Windows version, Username, etc.

Server folder drive mapped letter and folder that user has access to.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:shahedny
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
My smart TV isn't so smart 14 70
how to access my server 9 26
Use of Training Budget 12 64
Slow internet - due to unknown uploads 9 56
#Citrix #Citrix Netscaler #HTTP Compression #Load Balance
If you're not part of the solution, you're part of the problem.   Tips on how to secure IoT devices, even the dumbest ones, so they can't be used as part of a DDoS botnet.  Use PRTG Network Monitor as one of the building blocks, to detect unusual…
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…
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…

772 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now