+ Post New Thread
Results 1 to 11 of 11
Windows Thread, Dos Copy Command in Technical; There might be a really simple answer to this but I'm missing something ! I want to use a batch ...
  1. #1

    Join Date
    Apr 2007
    Location
    York
    Posts
    551
    Thank Post
    9
    Thanked 4 Times in 4 Posts
    Rep Power
    19

    Dos Copy Command

    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\LettersHo me\*.* \\2003server\d$\data\intranets\wamp\wamp\www\lette rs\*.*

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

  2. #2

    Domino's Avatar
    Join Date
    Oct 2006
    Location
    Bromley
    Posts
    4,126
    Thank Post
    215
    Thanked 1,255 Times in 786 Posts
    Blog Entries
    4
    Rep Power
    505
    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....

  3. #3
    Face-Man's Avatar
    Join Date
    Dec 2005
    Location
    London
    Posts
    577
    Thank Post
    11
    Thanked 58 Times in 40 Posts
    Rep Power
    70
    DOS won't like spaces in path and doesn't need the *.* at the end of the destination

  4. #4
    jamesreedersmith's Avatar
    Join Date
    Sep 2009
    Location
    Ruskington
    Posts
    1,152
    Thank Post
    78
    Thanked 253 Times in 227 Posts
    Rep Power
    76
    Try

    copy "\\2003server\sharedarea\_Teacher Admin\LettersHome\*.*" "\\2003server\d$\data\intranets\wamp\wamp\www\lett ers\*.*"

    Thanks

    James

  5. #5

    Join Date
    Apr 2007
    Location
    York
    Posts
    551
    Thank Post
    9
    Thanked 4 Times in 4 Posts
    Rep Power
    19
    No the spaces don't exist - just happened when i copied to here. The only space is between _Teacher Admin hence the %20

  6. #6
    DSapseid's Avatar
    Join Date
    Feb 2007
    Location
    West Sussex
    Posts
    1,152
    Thank Post
    130
    Thanked 54 Times in 47 Posts
    Rep Power
    38
    i use this when ever i have to do a copy

    xcopy "\\server\share\folder" "\\server\share\folder2" /s /c /i

  7. #7
    sharkster's Avatar
    Join Date
    Nov 2007
    Location
    Middlesbrough
    Posts
    149
    Thank Post
    23
    Thanked 26 Times in 21 Posts
    Rep Power
    18
    try this

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

    edit - or this

    net use Y: \\2003server\sharedarea\_TEACH~1\LettersHome
    net use Z: \\2003server\d$\data\intranets\wamp\wamp\www\lette rs
    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
    Last edited by sharkster; 15th October 2009 at 03:00 PM.

  8. #8

    Join Date
    Apr 2007
    Location
    York
    Posts
    551
    Thank Post
    9
    Thanked 4 Times in 4 Posts
    Rep Power
    19
    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?

  9. #9

    Join Date
    Feb 2006
    Location
    Derbyshire
    Posts
    1,381
    Thank Post
    181
    Thanked 211 Times in 171 Posts
    Rep Power
    65
    Not automatically - but you could script it using robocopy instead of xcopy, this has a mirror command which will delete files as needed to make each folder identical.

  10. #10

    Join Date
    Feb 2006
    Location
    Derbyshire
    Posts
    1,381
    Thank Post
    181
    Thanked 211 Times in 171 Posts
    Rep Power
    65
    Quote Originally Posted by jinnantonnix View Post
    Robocopy does provide a sync facility.
    Never noticed that switch before! I assume that means leaving a console/robocopy Window open all the time on the server though?

  11. #11
    kearton's Avatar
    Join Date
    May 2007
    Location
    Yorkshire, via NZ ;)
    Posts
    851
    Thank Post
    137
    Thanked 93 Times in 81 Posts
    Rep Power
    43
    +1 recommendation for Robocopy here...

SHARE:
+ Post New Thread

Similar Threads

  1. [Video] Advanced DOS strategies
    By mattx in forum Jokes/Interweb Things
    Replies: 0
    Last Post: 25th September 2009, 09:16 PM
  2. Citrix Dos client
    By KWestos in forum Thin Client and Virtual Machines
    Replies: 1
    Last Post: 6th July 2009, 01:23 PM
  3. Replies: 1
    Last Post: 1st February 2008, 11:32 AM
  4. Poss DOS problem
    By Gatt in forum *nix
    Replies: 1
    Last Post: 24th October 2006, 09:02 PM
  5. ARP overwritten DOS
    By CyberNerd in forum Wireless Networks
    Replies: 1
    Last Post: 24th May 2006, 12:10 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •