need a batch file please!

October 2, 2017 at 11:26:30
Specs: Windows 10
I want to be able to take an entire existing mp3 folder and move it inside a new folder based on artist name but I don't want the original folder name to be changed.

See More: need a batch file please!

Reply ↓  Report •

#1
October 3, 2017 at 03:06:12
Doing it by hand is probably less time consuming, besides im not even sure if what you are asking is possible with batch.
Unless ofcourse, the artist name is in the name of every .mp3 file

Simple solutions are often the best


Reply ↓  Report •

#2
October 3, 2017 at 05:06:35
It might be a REAL GOOD IDEA to post some file names.

=====================

M2 Get custom script or take private lessons


Reply ↓  Report •

#3
October 3, 2017 at 10:30:09
Unless the artist is in the file name, I'm pretty sure you can't achieve what you're asking as I highly doubt there is a way to read the metadata using batch

Don't worry if plan A fails, there are 25 more letters in the alphabet ;)


Reply ↓  Report •

Related Solutions

#4
October 3, 2017 at 13:47:59
Ok here is an example the dir is ----> Damageplan-New_Found_Power-CD-FLAC-2004
one of the mp3s are called -----------> 01-damageplan-wake_up
so basically I just want the original folder to be moved into a folder called Damageplan

Reply ↓  Report •

#5
October 3, 2017 at 15:46:10
that sounds possible, however im off to bed.
will look into this tommorow.

ill make a .bat which lets you choose "WORKINGDIRECTORY", "STRINGNAME", "DESTINATIONFOLDER"

Simple solutions are often the best


Reply ↓  Report •

#6
October 3, 2017 at 17:32:32
Sweet looking forward to it Thanks.

Reply ↓  Report •

#7
October 4, 2017 at 01:19:58
Let us know if it did it's job, it did work for me.

--------------start script.bat------------------
@echo off
:loop1
cls&echo Enter your Working folder/directory:
set /p "workingdir="
if "%workingdir%"=="" goto loop1
:loop2
cls&echo Enter the Artist name:
set /p "artist="
if "%artist%"=="" goto loop2
:loop3
cls&echo Enter the Destination folder/directory
set /p "dest="
if "%dest%"=="" goto loop3
:start
pushd %workingdir%
for /f "tokens=*" %%a in ('dir /A-D /B ^| findstr ".mp3" ^| find /I "%artist%"') do move "%workingdir%\%%a" "%dest%"
cls&echo DONE&timeout 3 >nul&exit /b
--------------end script.bat------------------

Simple solutions are often the best


Reply ↓  Report •

#8
October 4, 2017 at 03:45:23
Hi Hidde663 Thanks but this is way more than I need I just want to click the batch file in a folder filled with music folders and have those folders as is with their original titles just moved into new folders that are made of each of the artists. The artists folders can be made in the same working dir that all the original folders are in also. As an example
Music Folder/Damageplan-New_Found_Power-CD-FLAC-2004
will become
Music Folder/Damageplan/Damageplan-New_Found_Power-CD-FLAC-2004

Reply ↓  Report •

#9
October 4, 2017 at 03:58:37
Oh sorry must have read it wrong, i was thinking you have a whole bunch of .mp3's in 1 folder & wanted to sort them & put them in a folder with artist name.

Simple solutions are often the best


Reply ↓  Report •

#10
October 4, 2017 at 04:09:34
RE #8, does exactly that, run from "Music folder"

--------------start script1.bat------------------
@echo off
:loop1
cls&echo Enter the Artist name:
set /p artist=
if "%artist%"=="" goto loop1
for /f "tokens=*" %%a in ('dir /B ^| find /I "%artist%"') do if not exist %artist% (mkdir %artist%)& move "%%a" %artist%&exit/b
--------------end script1.bat------------------

message edited by hidde663


Reply ↓  Report •

#11
October 4, 2017 at 10:34:26
Hidde663 I so appreciate all the work you are doing. I tried the last batch you made and it kinda works if I put in a single artist name but what I really wanted was for me NOT to have to enter any information myself. as having to type a Artist name is almost the same as just creating a dir and typing in the name myself. I just want to click on the batch and have it automatically just sort each album folder in a new folder under the artist name by somehow having the batch command look at the artist name from within the dir title or from the mp3 file. Allthough I think the dir title may be easier as if it is a compilation cd there would be many new dirs made and that would be annoying.If this can't be accomplished I thank you for all the effort and time you have put in for me already.

Reply ↓  Report •

#12
October 5, 2017 at 00:44:41
Perhaps if you gave me a list of all the artists it could be done, but i don't think that would be any more efficient than doing it by hand or using the .bat from #10.

So No, to my knowledge of batch I can not make this much better without spending a lot of time & having a list of every possible artist in your music folder.

Simple solutions are often the best


Reply ↓  Report •

#13
October 14, 2017 at 18:34:44
Assuming your directory names are formatted like in the example you provided, (<artist>-<album>), I came up with this little piece of code. Takes the assumed artist name, creates a directory of that name, then moves the correct folders into that folder.

@echo off
setlocal enabledelayedexpansion
cd "%~dp0"
for /f "tokens=*" %%A in ('dir /b /a:d') do (
	for /f "tokens=1,* delims=-" %%B in ("%%A") do (
		if not exist "%%B" (
			mkdir "%%B"
		)
		move "%%A" "%%B\"
	)
)
Echo Done.
pause

I think this is what you were after?

Don't worry if plan A fails, there are 25 more letters in the alphabet ;)

message edited by RainBawZ


Reply ↓  Report •

Ask Question