We help IT Professionals succeed at work.

batch copy folder

mjelec
mjelec asked
on
468 Views
Last Modified: 2013-11-10
I am trying to figure out how to create a batch file script to copy a single folder example I have tried:

xcopy \\server\folder \\server\copied folder

I have received the following errors:

invalid path
too many parameters (fixed with quotations)
"CMD.EXE was started with the above path as the current directory. UNC paths are not supported. Defaulting to Windows directory."

the last error has only shown up recently and i have not figured out where it has come from.

thanks in advance.
Comment
Watch Question

CERTIFIED EXPERT

Commented:
use /e, and  put quotes around the source and destination:

xcopy/e  \\server\folder"  "\\server\copied folder"

Commented:
xcopy \\server\folder "\\server\copied folder"

copied folder has a space in it...
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
too many parameters has already been fixed by the quotations

I tried xcopy/e and still received invalid path and the cmd.exe error messages
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.