0
teamhypoxia

Programmer types Help!

Recommended Posts

got a little problem here at work....

there are multiple files living on a server in our office in another city. I need to frequently copy those files onto either a local server or my hard drive.
the files are nested within seperate subfolders and need to be copied to identical seperate subfolders.
I am currently doing it by navigating via explorer and "drag and dropping" but this is cumbersome. I'm thinking I need a .bat file or something that I can simply execute to automate this silliness but I have no idea how to write script for a .bat file. can anyone help me out? perhaps with a sample .bat script that I can reverse engineer? or even another suggestion entirely?

thanks

Share this post


Link to post
Share on other sites
Use xcopy. With the appropriate settings it will do exactly what you want. Type in xcopy /? to get the help information.

example

xcopy /E /Z /Y c:\source\* d:\destination

This will copy all files and directories including empty directories into the destination. Not exactly what you want but you can modify it to do what you need.

Share this post


Link to post
Share on other sites
Quote

Use xcopy. With the appropriate settings it will do exactly what you want. Type in xcopy /? to get the help information.

example

xcopy /E /Z /Y c:\source\* d:\destination

This will copy all files and directories including empty directories into the destination. Not exactly what you want but you can modify it to do what you need.


is this something I can write into a .bat file with all the file paths so that I can simply execute the .bat to automate it?

Share this post


Link to post
Share on other sites
Scheduled XCOPY works for what it does, but it's not very robust in terms of logging, real-time sync, flexible scheduling, caching, etc.

Windows 2000 and 2003 have the kludgy File Replication Service (FRS), which requires Active Directory for use. Other COTS options range from lower-end products like Second Copy to Legato's line of enterprise replication software (Replistor, DiskXtender, etc.).

Depending on business need and budget, you may wish to look down that path, as well.

Share this post


Link to post
Share on other sites
Yes, you can put this in a bat file with hardcoded paths. Just beware that if someone is using the file while it's being copied, problems could come up (file's get locked by O/S, or the copies aren't actually in sync like you thought). Unless many people are using the files alot, I wouldn't worry about it. If you are using the files alot, maybe should look into putting the data in a relational database (MS SQL Server, etc.).
We are all engines of karma

Share this post


Link to post
Share on other sites
not using the quotations in the file at all... just on here

here's one line of it:

xcopy /D /Z /Y K:\Memorial_North_Hospital\Constructs\Plumbing_&_Piping\Med_Gas\00MG.dwg C:\Documents_and_Settings\ericj.HPE\Desktop\Memorial_North_Hospital\Constructs\Plumbing_&_Piping\Med_Gas\00MG.dwg

& can't be helped at this point

Share this post


Link to post
Share on other sites
oh use the quotations to deal with the special characters. The quotations will allow you to copy files and directories with spaces.
For some reason I looked at "_" and saw quotations only. It's been a long day.:S


example

xcopy /D /Z /Y "K:\Memorial_North_Hospital\Constructs\Plumbing_&_Piping\Med_Gas\00MG.dwg" "C:\Documents_and_Settings\ericj.HPE\Desktop\Memorial_North_Hospital\Constructs\Plumbing_&_Piping\Med_Gas\00MG.dwg"

Share this post


Link to post
Share on other sites
Quote

I'm not really much of a computer geek, but I play one at work



I thought you were a plumber. I wanted to see your butt crack:P
May your trails be crooked, winding, lonesome, dangerous, leading to the most amazing view. May your mountains rise into and above the clouds. - Edward Abbey

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

0