Forum Home
Press F1
 
Thread ID: 98016 2009-03-08 00:32:00 DOS or XCOPY experts wanted FoxyMX (5) Press F1
Post ID Timestamp Content User
754555 2009-03-08 00:32:00 Here's a challenge for the DOS and XCOPY experts. :thumbs:

For some reason my XCOPY commands are no longer working properly. They will copy sometimes but not others, mostly not others, and I am completely mystified as to why.

This one just did the bizzo, copying all the folders and files to a new folder PHOTOs:

xcopy H:\PHOTOS\*.* M:\PHOTOS\*.* /y/d/s

BUT when I added a new folder it wouldn't copy it. When I added a file to that folder it then did copy it.

Also, if I change the command to the following...

xcopy D:\Canon\*.* H:\Canon\*.* /y/d/s

... it won't work. Nothing gets copied, even though there are many new folders and files that should be copied.

This is all very strange behaviour as it used to work fine. Anyone have any idea why? No updates have been applied recently.
FoxyMX (5)
754556 2009-03-08 00:49:00 Why don't you just use something like syncback?

BTW jwil may be able to help you with this, I've read a bit about it on his blog.

The problem you have is quite baffling indeed though
Blam (54)
754557 2009-03-08 01:00:00 /S is your problem. Use /E instead :)

/S excludes empty directories, while /E copies empty ones as well.
jwil1 (65)
754558 2009-03-08 02:06:00 /S is your problem. Use /E instead :)

/S excludes empty directories, while /E copies empty ones as well.

Well, I learnt something today! :thumbs:

Those /y/d/s commands always were a bit of a mystery to me. I just used them because that's what Godfather uses. :p

However, it hasn't fixed my problem. :(

Since starting this thread I tried leaving out the /y/d/s bits and it still doesn't do the job. The following line will copy my Eudora folder only and nothing else, even though there are other folders with files that should be copied:

xcopy d:\Documents\*.* h:\Documents\*.* /y/d/e

I am becoming convinced that there is something wrong with my folders somehow. Does it matter if the folders and files are Read Only? I am sure some files have always been Read Only and still copied over.
FoxyMX (5)
754559 2009-03-08 02:10:00 You should look at robocopy. Replacement for XCOPY that handles long file names and offers additional functions such as logging and archiving. HAL9000 (12736)
754560 2009-03-08 03:54:00 Try taking out the *.*, putting "" around the D:\Documents and H:\Documents. Also have a look at my blog http://g33kblog.wordpress.com to see if my version works any better :) jwil1 (65)
754561 2009-03-08 21:56:00 Theres a know bug in xcopy (xcopy32?) where it will SOMETIMES simply stops/crashes out of the copy without warning(especially if theres alot of files/nested sub-dirs). Ive seen it a few times.
Use xxcopy instead.
sroby (11519)
754562 2009-03-08 22:50:00 Theres a know bug in xcopy (xcopy32?) where it will SOMETIMES simply stops/crashes out of the copy without warning(especially if theres alot of files/nested sub-dirs) . Ive seen it a few times .
Use xxcopy instead .

That happened to me - I think having too large a folder to copy from makes it crash?

I made it look at folders one level down and it was fine .
jwil1 (65)
754563 2009-03-08 23:41:00 In case you don't know....

To see what a DOS command does (including switches) you only need to open a command window (Windows Key + R - then type CMD or COMMAND followed by ENTER, type EXIT to close the command window) and type the command followed by "/?" excluding the quotes:

e.g. for xcopy - type "xcopy /?" (excl quotes).

This is the result:

Copies files and directory trees.

XCOPY source [destination] [/A | /M] [/D[:date]] [/P] [/S [/E]] [/V] [/W]
[/C] [/I] [/Q] [/F] [/L] [/G] [/H] [/R] [/T] [/U]
[/K] [/N] [/O] [/X] [/Y] [/-Y] [/Z]
[/EXCLUDE:file1[+file2][+file3]...]

source Specifies the file(s) to copy.
destination Specifies the location and/or name of new files.
/A Copies only files with the archive attribute set,
doesn't change the attribute.
/M Copies only files with the archive attribute set,
turns off the archive attribute.
/D:m-d-y Copies files changed on or after the specified date.
If no date is given, copies only those files whose
source time is newer than the destination time.
/EXCLUDE:file1[+file2][+file3]...
Specifies a list of files containing strings. Each string
should be in a separate line in the files. When any of the
strings match any part of the absolute path of the file to be
copied, that file will be excluded from being copied. For
example, specifying a string like \obj\ or .obj will exclude
all files underneath the directory obj or all files with the
.obj extension respectively.
/P Prompts you before creating each destination file.
/S Copies directories and subdirectories except empty ones.
/E Copies directories and subdirectories, including empty ones.
Same as /S /E. May be used to modify /T.
/V Verifies each new file.
/W Prompts you to press a key before copying.
/C Continues copying even if errors occur.
/I If destination does not exist and copying more than one file,
assumes that destination must be a directory.
/Q Does not display file names while copying.
/F Displays full source and destination file names while copying.
/L Displays files that would be copied.
/G Allows the copying of encrypted files to destination that does
not support encryption.
/H Copies hidden and system files also.
/R Overwrites read-only files.
/T Creates directory structure, but does not copy files. Does not
include empty directories or subdirectories. /T /E includes
empty directories and subdirectories.
/U Copies only files that already exist in destination.
/K Copies attributes. Normal Xcopy will reset read-only attributes.
/N Copies using the generated short names.
/O Copies file ownership and ACL information.
/X Copies file audit settings (implies /O).
/Y Suppresses prompting to confirm you want to overwrite an
existing destination file.
/-Y Causes prompting to confirm you want to overwrite an
existing destination file.
/Z Copies networked files in restartable mode.

The switch /Y may be preset in the COPYCMD environment variable.
This may be overridden with /-Y on the command line.


BTW: to get a list of available DOS commands type "HELP" at the prompt in the command window. Remember to be careful! some commands can 'hurt' your system - e.g. FORMAT.
ManUFan (7602)
754564 2009-03-09 02:02:00 Hey wow SyncBack Free looks useful!! Chilling_Silence (9)
1 2