Solved

Is it possible to merge multiple directories into a single directory?

Posted on 2006-11-02
2
430 Views
Last Modified: 2008-01-09
I have a directory with 100 subfolders. I want to merge the files from all the subfolders into a single folder.  Is this easily accomplished in Windows?

Kind Regards and thanks in advance for any help.
0
Comment
Question by:FocusedEnergy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 6

Accepted Solution

by:
vtsinc earned 500 total points
ID: 17860586
I'm not aware of a built-in way to do it but you could try the XXCOPY utility available at www.xxcopy.com.  It allows you do do a copy operation and f"flatten" the subdirectories into a single directory using the /SX switch.  Here's output from the command-line help:

XXCOPY  == Freeware ==    Ver 2.93.1  (c)1995-2006 Pixelab, Inc.

XXCOPY src [ dst ] [ options... ]
        src  specifies the source file(s) or directory to copy
        dst  specifies the destination directory (no file names)

  Option switches start with a slash (/) immediately followed by letter(s).
  XXCOPY supports most XCOPY switches (/A/M/P/S/E/T/W/C/I/F/L/H/R/U/K/Y/N).
         /S  Copies subdirectories       /K  Keeps file attibutes as in src
         /H  Copies hidden files also    /U  Updates files that exist in dst

     /CLONE  Duplicates a directory (or entire volume) as incremental backup.
    /BACKUP  Backs up the directory without deleting extra files.
        /SG  Gathers files from subdirectories into one directory.
        /SX  Flattens subdirectories into a one-level directory.
   /SZ:-<n>  Copies files whose size is <n> bytes or less.
         /Z  Deletes extra files/dirs in the destination (/ZY, without prompt).
  /DA:<date> (/DB:<date>)  Copies files made on/after (before) the date.
  /X<fspec>  Excludes file(s) which match <fspec> pattern (wildcard OK).
         /Y  No prompt on file overwrite  (/YY  Suppreses nearly all prompts).
      /HELP  Displays a full help text, (/HELPA in alphabetical order).
         /?  Displays a focused help text with the switch(es) you specify.
  Over 160 switches in all (visit http://www.xxcopy.com for details).

C:\Documents and Settings\mdurkin.VTS-INC>
0
 

Author Comment

by:FocusedEnergy
ID: 17861113
Thanks so much! This definitely answers my question though I didn't end up using it.  A colleague suggested that I zip the directory and not maintain the tree structure, one unzip later and I was home free!

0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
Had a business requirement to store the mobile number in an environmental variable. This is just a quick article on how this was done.
Suggested Courses

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question