Solved

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

Posted on 2001-09-14
4
123 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
  • 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

A Bare Metal Image backup allows for the restore of an entire system to a similar or dissimilar hardware. They are highly useful for migrations and disaster recovery. Bare Metal Image backups support Full and Incremental backups. Differential backup…
Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
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.
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

758 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now