Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying to flatten an existing directory with subdirectories into another directory using xxcopy.

My command currently looks like:

xxcopy .\VisitraxImages .\VisitraxImagesNew /s /sx

Unfortunately this command results in filenames that contain the former subfolder's name in them.

For example, if a file named bob.joe.TR.2.13.13.pdf in the source directory (.\VisitraxImages) was in a sub-directory called the_directory, when it copies over to the newly flattened directory (.\VisitraxImagesNew) it would be named bob.joe.TR.2.13.13'the_directory.pdf instead of bob.joe.TR.2.13.13.pdf

I would rather exclude the duplicate filename and be notified of duplicate filenames in the command output than outright change the filename all together. Is there a way to do this?

share|improve this question
    
Sort of found a solution but not exactly...there's a way to copy the newest file with the name into the flattened directory if you take my command above and add the /SGN switch to it... xxcopy.com/xxcopy16.htm –  leeand00 Mar 1 '13 at 19:31
add comment

1 Answer

Sort of found a solution but not exactly...there's a way to copy the newest file with the name into the flattened directory if you take my command above and add the /SGN switch to it... Source: xxcopy.com/xxcopy16.htm

xxcopy .\VisitraxImages .\VisitraxImagesNew /s /sx / SGN
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.