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 ...
-
15th October 2009, 12:00 PM #1
- 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 !
-
-
IDG Tech News
-
15th October 2009, 12:02 PM #2 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....
-
-
15th October 2009, 12:02 PM #3 DOS won't like spaces in path and doesn't need the *.* at the end of the destination
-
-
15th October 2009, 12:04 PM #4 Try
copy "\\2003server\sharedarea\_Teacher Admin\LettersHome\*.*" "\\2003server\d$\data\intranets\wamp\wamp\www\lett ers\*.*"
Thanks
James
-
-
15th October 2009, 12:07 PM #5
- 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
-
-
15th October 2009, 02:40 PM #6 i use this when ever i have to do a copy
xcopy "\\server\share\folder" "\\server\share\folder2" /s /c /i
-
-
15th October 2009, 02:56 PM #7 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.
-
-
15th October 2009, 03:24 PM #8
- 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?
-
-
15th October 2009, 03:41 PM #9 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.
-
-
15th October 2009, 04:05 PM #10 
Originally Posted by
jinnantonnix
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?
-
-
15th October 2009, 04:53 PM #11 +1 recommendation for Robocopy here...
-
SHARE:
Similar Threads
-
By mattx in forum Jokes/Interweb Things
Replies: 0
Last Post: 25th September 2009, 09:16 PM
-
By KWestos in forum Thin Client and Virtual Machines
Replies: 1
Last Post: 6th July 2009, 01:23 PM
-
Replies: 1
Last Post: 1st February 2008, 12:32 PM
-
Replies: 1
Last Post: 24th October 2006, 09:02 PM
-
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
-
Forum Rules