+ 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
    481
    Thank Post
    6
    Thanked 4 Times in 4 Posts
    Rep Power
    14

    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. IDG Tech News

  3. #2

    Domino's Avatar
    Join Date
    Oct 2006
    Location
    Bromley
    Posts
    3,225
    Blog Entries
    4
    Thank Post
    100
    Thanked 670 Times in 476 Posts
    Rep Power
    240
    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....

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

  5. #4
    jamesreedersmith's Avatar
    Join Date
    Sep 2009
    Location
    Ruskington
    Posts
    926
    Thank Post
    75
    Thanked 203 Times in 179 Posts
    Rep Power
    54
    Try

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

    Thanks

    James

  6. #5

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

  7. #6
    DSapseid's Avatar
    Join Date
    Feb 2007
    Location
    West Sussex
    Posts
    1,027
    Thank Post
    105
    Thanked 35 Times in 30 Posts
    Rep Power
    22
    i use this when ever i have to do a copy

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

  8. #7
    sharkster's Avatar
    Join Date
    Nov 2007
    Location
    Middlesbrough
    Posts
    149
    Thank Post
    23
    Thanked 26 Times in 21 Posts
    Rep Power
    14
    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.

  9. #8

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

  10. #9

    Join Date
    Feb 2006
    Location
    Derbyshire
    Posts
    1,381
    Thank Post
    181
    Thanked 211 Times in 171 Posts
    Rep Power
    60
    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.

  11. #10

    Join Date
    Feb 2006
    Location
    Derbyshire
    Posts
    1,381
    Thank Post
    181
    Thanked 211 Times in 171 Posts
    Rep Power
    60
    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?

  12. #11
    kearton's Avatar
    Join Date
    May 2007
    Location
    Essex. A long way from NZ!
    Posts
    582
    Thank Post
    75
    Thanked 31 Times in 28 Posts
    Rep Power
    25
    +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, 12:32 PM
  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 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
  •