0

Yes, I found this superuser question, but it misses the different directory strucutre.

I have files on the server that are in a directory structure

\server\dir1\file1, \server\dir1\file2, \server\dir3\file9, and so on

Some of the files are on a client computer. But on the client computer all files are in one directory.

Now I want to copy all files (regardless of subdirectory on server) from the server to the client that are already on the client and replace the client version.

any idea how to do that?

thank you Daniel

1
  • 1
    You want to copy all files on client computer, which exist in 1 folder and work out first if the file already exists on the server, and if so replace it, if not, add it somewhere? Regardless, what have you tried, we're not here to write your script! Show us your effort first and then we can see where you've gone wrong and help.
    – Dave
    Commented Sep 27, 2016 at 7:34

1 Answer 1

0

After a bit of trying I found out where I was wrong, this is the working script:

net use /delete x:
net use x: \\server\share 
cd /d x:
FOR /D /r %%G in ("*") DO robocopy %%G C:\test /XL /Z /XO
net use /delete x:

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .