I've been doing some archiving of my music library lately. I have finalized my batch script as follows:
@echo off
for /r %%a in (*.mp3) do (
if exist "%%~dpna.txt" (
Echo "%%~dpna.txt" already present, skip
) else (
for /f "tokens=1,*delims=-" %%b in ("%%~na") do (
echo Artist: %%b
echo Song :%%c asdad
)>"%%~dpna.txt"
)
)
Pretty good so far. Had help in the forum as well. >> Parse file name using batch automation
With this script I was able to accomplish the output by parsing and using the file name. But the problem I face now is, not all my files are not in the same format. So further research for my goal. I decided to accomplish my task by extracting metadata using ffprobe. Code seems fine but I can't seem to echo the result and it's showing echo off. Any help would be much appreciated.
Current code is as follows.
@echo off
for /r %%a in (*.mp3) do (
if exist "%%~dpna.txt" (
Echo "%%~dpna.txt" already present, skip
) else (
for /F "delims=" %%I in ('ffprobe -v error -show_entries format_tags^=title,artist,comment -of default^=noprint_wrappers^=1:nokey^=1 %aa') do set "title=%%I"
)>"%%~dpna.txt"
)
)