Solved

Move a bunch of files from sub folders to the top folder

Posted on 2001-09-14
4
127 Views
Last Modified: 2013-12-28
Is there a way I can move all the files from sub folder to the top folder .. for example I have a lot of files saved as:

C:\Files\A\FileA.txt
C:\Files\B\FileB.txt
C:\Files\C\....
....
....
C:\Files\z\....

I want to move all the files from the C:\Files sufolders and sub sub-folders to the top folder

So the top folders are saved under

C:\Files\FileA.txt
C:\Files\FileB.txt

and so on ...


0
Comment
Question by:amira123
[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
4 Comments
 
LVL 5

Expert Comment

by:d_hall
ID: 6484279
Well, obviously you yould drag and drop using explorer, but I'm assuming that you have a lot of files to deal with so that is impractical.

Easiest way I can think of is a DOS batch file.  The only caveat is that this may have problems with files with irregular characters in the name (like  .  or  -  ).


Go Start > Run and enter "command" to start a DOS prompt.

Enter "dir C:\Files /S /B /O:G > file.bat"

This will create a list of all the files and their subdirectories in a text file called <file.bat>.

Then open this file by entering "edit file.bat".

Go to the Replace menu item, and replace "C:\" with "copy C:\"

Then at the start of the file add these lines:

  cd c:
  cd Files

Now, if you go back to the prompt and enter "file" the batch file will run and copy all the files from the subdirs into C:\Files


If you want to delete all the files from the subfolders, just use the replace option to replace "copy" with "del".
0
 
LVL 5

Expert Comment

by:d_hall
ID: 6484280
>> Then at the start of the file add these...


On further reflection, might be best to add

  cd c:
  cd\
  cd Files
0
 
LVL 5

Accepted Solution

by:
pelejab earned 50 total points
ID: 6484472
you could also use the find command (ie right click the start button and select find) and set *.txt as files to find in "named" box, and select whole of C: drive in "look-in" box then click the find now button. Once it has finished finding the files click the grey "In Folder" column to sort in folders order and then select all the files using click top file of list then shift click bottom file of list and select cut. Then in windows explorer paste these files to the required directory.
cheers, Pete
0
 

Author Comment

by:amira123
ID: 6484584
Here is a situation where both answers were good.  I thought pelejab's was more convienient for me.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

No single Antivirus application (despite claims by manufacturers) will catch or protect you from all Virus / Malware or Spyware threats. That doesn't stop you from further protecting yourself however - and this article is to show you how.
There are many software programs on offer that will claim to magically speed up your computer. The best advice I can give you is to avoid them like the plague, because they will often cause far more problems than they solve. Try some of these "do it…
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

738 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