Solved

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

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

Do email signature updates give you a headache?

Constantly trying to correctly format email signatures? Spending all of your time at every user’s desk to make updates? Want high-quality HTML signatures on all devices, including on mobiles and Macs? Then, let Exclaimer solve all your email signature problems today!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Can upgarde to Windows 10 help to block the spread of ransomware? 8 65
deploy workstation 4 74
Windows IPv6 DHCP server 8 34
Windows USB 4TB Backup Drive 7 29
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
In this article, I will show you HOW TO: Perform a Physical to Virtual (P2V) Conversion the easy way from a computer backup (image).
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …

919 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

14 Experts available now in Live!

Get 1:1 Help Now