Jump to content

Recommended Posts

Posted

There might be a really simple answer to this but I'm missing something ! I want to use a batch file to copy the contents of one folder to another. Simples.

 

Batch file :

copy \\2003server\sharedarea\_Teacher%20Admin\LettersHome\*.* \\2003server\d$\data\intranets\wamp\wamp\www\letters\*.*

 

Doesn't work though. Am I missing something obvious !

Posted

I assume the spaces in the file locations aren't present in your actual command?

 

I've always found robocopy to be much more reliable anyway....

Posted (edited)

try this

 

xcopy \\2003server\sharedarea\_TEACH~1\LettersHome\*.* \\2003server\d$\data\intranets\wamp\wamp\www\letters\*.*

 

edit - or this

 

net use Y: \\2003server\sharedarea\_TEACH~1\LettersHome

net use Z: \\2003server\d$\data\intranets\wamp\wamp\www\letters

xcopy Y:\*.* Z:\ /d/e

net use Y: /del

net use Z: /del

 

the /d/e switch make it copy all folders within that directory and also any files that have been modified

 

- 2nd edit

 

this does add spacces inbetween the word "letters" so make sure ya dont copy that acrross

Edited by sharkster
Posted
Thanks. Managed to get it to work now. Is there a way to sync the folder. Got it to copy one way. If the file is deleted in the original folder is there a way to delete the file in the copied folder too?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...