Solved

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

Posted on 2006-11-02
2
426 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
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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Migrate DFS role 3 856
P2V conversion for Windows NT 4.0 Server 2 2,289
Disk size support for operating systems 12 535
testing the trust relationship between two domain 1 88
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…
Starting your own business is always a daunting process, and for most people it is brand new experience. Avoid the common pitfalls by following these tips to start on the road to success.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

808 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