# Fastest way to move files to a folder and create the folder :XP

**URL:** https://boards.straightdope.com/t/fastest-way-to-move-files-to-a-folder-and-create-the-folder-xp/361238
**Category:** Factual Questions
**Created:** [June 19, 2006, 2:13am UTC](https://boards.straightdope.com/t/fastest-way-to-move-files-to-a-folder-and-create-the-folder-xp/361238 "2006-06-19T02:13:17Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![MannyL](https://avatars.discourse-cdn.com/v4/letter/m/ba8739/32.png) [@MannyL](https://boards.straightdope.com/u/MannyL)
#### Post date: [June 19, 2006, 2:13am UTC](https://boards.straightdope.com/t/fastest-way-to-move-files-to-a-folder-and-create-the-folder-xp/361238/1 "2006-06-19T02:13:17Z")

</div>

I’m Trying to organise my files I see I have many cd’s that I ripped into .MP3 named as follows

cd?-??-??-trackname

I want to reorganize my files so for every cd?-??-??? there is a folder called cd? and in it is the files cd?-??-??-trackname

I know a simple batch script will do it but I can’t figure out how to write it. Any suggestions?

---

<div class="post-metadata">

### Author: ![What\_Exit](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/what_exit/32/10652_2.png) [@What\_Exit](https://boards.straightdope.com/u/What_Exit)
#### Post date: [June 19, 2006, 2:15am UTC](https://boards.straightdope.com/t/fastest-way-to-move-files-to-a-folder-and-create-the-folder-xp/361238/2 "2006-06-19T02:15:49Z")

</div>

What Music ripping software do you use? The much maligned Windows Media Player 10 or 11 does this for me.

Jim

---

<div class="post-metadata">

### Author: ![MannyL](https://avatars.discourse-cdn.com/v4/letter/m/ba8739/32.png) [@MannyL](https://boards.straightdope.com/u/MannyL)
#### Post date: [June 19, 2006, 2:18am UTC](https://boards.straightdope.com/t/fastest-way-to-move-files-to-a-folder-and-create-the-folder-xp/361238/3 "2006-06-19T02:18:39Z")

</div>

> [@What Exit?](#):
>
> What Music ripping software do you use? The much maligned Windows Media Player 10 or 11 does this for me.
> 
> Jim

I forget exactly what I used it was either Music Match or another program but what happened is I ended up somehow moving all the files from every cd into one folder and now I’m trying to straighten out the mess

---

<div class="post-metadata">

### Author: ![What\_Exit](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/what_exit/32/10652_2.png) [@What\_Exit](https://boards.straightdope.com/u/What_Exit)
#### Post date: [June 19, 2006, 2:29am UTC](https://boards.straightdope.com/t/fastest-way-to-move-files-to-a-folder-and-create-the-folder-xp/361238/4 "2006-06-19T02:29:24Z")

</div>

> [@MannyL](#):
>
> I forget exactly what I used it was either Music Match or another program but what happened is I ended up somehow moving all the files from every cd into one folder and now I’m trying to straighten out the mess

Gotcha, try this shareware from PC world. It might do the trick, and there software is spy-ware safe from my experience.  
IM Collector Music Edition  
[http://www.pcworld.com/downloads/file\_description/0,fid,61842,00.asp#](http://www.pcworld.com/downloads/file_description/0,fid,61842,00.asp#)

---

<div class="post-metadata">

### Author: ![MannyL](https://avatars.discourse-cdn.com/v4/letter/m/ba8739/32.png) [@MannyL](https://boards.straightdope.com/u/MannyL)
#### Post date: [June 19, 2006, 2:48am UTC](https://boards.straightdope.com/t/fastest-way-to-move-files-to-a-folder-and-create-the-folder-xp/361238/5 "2006-06-19T02:48:54Z")

</div>

That application looks like it may work if it accepts .zip format. The song files are mp3’s plus the album image plus lyrics where I could find them

---

<div class="post-metadata">

### Author: ![What\_Exit](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/what_exit/32/10652_2.png) [@What\_Exit](https://boards.straightdope.com/u/What_Exit)
#### Post date: [June 19, 2006, 2:54am UTC](https://boards.straightdope.com/t/fastest-way-to-move-files-to-a-folder-and-create-the-folder-xp/361238/6 "2006-06-19T02:54:53Z")

</div>

> [@MannyL](#):
>
> That application looks like it may work if it accepts .zip format. The song files are mp3’s plus the album image plus lyrics where I could find them

Good luck, I am sorry I cannot be off more use. WMP has spoiled me by doing the job for me.

---

<div class="post-metadata">

### Author: ![MannyL](https://avatars.discourse-cdn.com/v4/letter/m/ba8739/32.png) [@MannyL](https://boards.straightdope.com/u/MannyL)
#### Post date: [June 19, 2006, 5:06am UTC](https://boards.straightdope.com/t/fastest-way-to-move-files-to-a-folder-and-create-the-folder-xp/361238/7 "2006-06-19T05:06:26Z")

</div>

Well that program did not work. I hacked together a little script below

```auto

mkdir cd22%1
cd cd22%1
dir ..\..\cd22%1-*.*
move ..\..\cd22%1-*.* .
cd ..

```

I can run it as follows C: o Sort\Misc Music\Unorgainized which has files named  
cd2203 through cd2439

example

doit 10 would  
create C: o Sort\Misc Music\Unorgainized\Cd10  
then copy the contents of cd10 to the new direcory.

I know I can mahually run in 99 times each time incrasing the number by 1 then changing the the .cmd file to start over at 23 and manually doing 01 though 99 but I know there has to be a way to loop trhis but I can’t figure out the syntax.

Any suggestions are appreciated

---

<div class="post-metadata">

### Author: ![Mangetout](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/mangetout/32/19_2.png) [@Mangetout](https://boards.straightdope.com/u/Mangetout)
#### Post date: [June 19, 2006, 7:57am UTC](https://boards.straightdope.com/t/fastest-way-to-move-files-to-a-folder-and-create-the-folder-xp/361238/8 "2006-06-19T07:57:15Z")

</div>

I wrote a small piece of VB that will do something like this; my bird box webcam (see sig) software saved the pictures all in the same folder as [date]-[time]-[serial number].jpg - after a week or so of storing one photo per minute, 24 hours a day, it got so that Windows didn’t like opening the folder at all - because it was trying to refresh thumbnails of tens of thousands of images.

My program created folders as required using the front part of the filename, then moved all of the relevant files into it, continuing until none were left unfiled. I don’t have a copy here, but I can post the code tonight - if you have some way of running VB (for example. MS Access, or Visual Basic Express - which is available for free download), then it shouldn’t be too hard to modify so that it creates a folder name based on the position of the first dash character.

---

<div class="post-metadata">

### Author: ![Cazzle](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/cazzle/32/75_2.png) [@Cazzle](https://boards.straightdope.com/u/Cazzle)
#### Post date: [June 19, 2006, 8:42am UTC](https://boards.straightdope.com/t/fastest-way-to-move-files-to-a-folder-and-create-the-folder-xp/361238/9 "2006-06-19T08:42:11Z")

</div>

Just FYI, iTunes organises your MP3s into iTunes Music/Artist/Album/track number track title.mp3 if you choose “Keep iTunes Music Folder Organised” and “Copy Files to iTunes Music folder when added to library” under preferences. I realise not everyone likes to use iTunes.

---

<div class="post-metadata">

### Author: ![LSLGuy](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/lslguy/32/5813_2.png) [@LSLGuy](https://boards.straightdope.com/u/LSLGuy)
#### Post date: [June 19, 2006, 12:22pm UTC](https://boards.straightdope.com/t/fastest-way-to-move-files-to-a-folder-and-create-the-folder-xp/361238/10 "2006-06-19T12:22:24Z")

</div>

The loop construct you want is something like

C:…\> FOR /L %x IN (0,99,1) doit %x

type FOR /? for more info

Note that if you embed that statement in a batch file it needs to be reworked as

FOR /L %%x in (0,99,1) doit %%x

---

<div class="post-metadata">

### Author: ![Ximenean](https://avatars.discourse-cdn.com/v4/letter/x/aca169/32.png) [@Ximenean](https://boards.straightdope.com/u/Ximenean)
#### Post date: [June 19, 2006, 1:36pm UTC](https://boards.straightdope.com/t/fastest-way-to-move-files-to-a-folder-and-create-the-folder-xp/361238/11 "2006-06-19T13:36:17Z")

</div>

Make a batch file called something like MDandMove.bat, containing this:

```auto

set filename=%1
set dest=%filename:~0,3%
md %dest%
move %filename% %dest%

```

Then call it with the FOR loop

```auto

for %i in (cd?-*) do call MDandMove.bat %i

```

---

<div class="post-metadata">

### Author: ![MannyL](https://avatars.discourse-cdn.com/v4/letter/m/ba8739/32.png) [@MannyL](https://boards.straightdope.com/u/MannyL)
#### Post date: [June 21, 2006, 2:44am UTC](https://boards.straightdope.com/t/fastest-way-to-move-files-to-a-folder-and-create-the-folder-xp/361238/12 "2006-06-21T02:44:00Z")

</div>

Thanks LSLGuy and Usram

---

<div class="post-metadata">

### Author: ![duffer](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/duffer/32/1026_2.png) [@duffer](https://boards.straightdope.com/u/duffer)
#### Post date: [June 21, 2006, 3:11am UTC](https://boards.straightdope.com/t/fastest-way-to-move-files-to-a-folder-and-create-the-folder-xp/361238/13 "2006-06-21T03:11:52Z")

</div>

I’ll second the new WMP. If you’re familiar with previous versions, this should be a snap to figure out.

Depending on your patience level and how many files there are, why not just make folders for each band, and sub-folders for each album? I realize Windows gets a knock from certain people, but it’s so easy to use for these kinds of tasks, I don’t see the use for writing a script.

Right-click the desktop and make new folders for how ever many bands you have. Or genres and sub-folder from there. Open the directory with the files and drag-and-drop. Then organize the folders into wahtever directory you want.  
Again, maybe too much a PITA for you, but simple nonetheless.

---

<div class="post-metadata">

### Author: ![MannyL](https://avatars.discourse-cdn.com/v4/letter/m/ba8739/32.png) [@MannyL](https://boards.straightdope.com/u/MannyL)
#### Post date: [June 21, 2006, 4:04am UTC](https://boards.straightdope.com/t/fastest-way-to-move-files-to-a-folder-and-create-the-folder-xp/361238/14 "2006-06-21T04:04:58Z")

</div>

Well these are karaoke files. They are .zip’s consisting of a .mp3 and a .cdg which is sound and graphic so Windows Media Player won’t work on these. I’m trying to put them back in album order
