@ECHO OFF
COLOR f9
MODE con:cols=78 lines=22
TITLE ^(^(.::^>-{ FLAC Converter }-^<::.^)^)
PUSHD %~dp0
FOR /F "delims=" %%A IN ("%CD%\..") DO SET "DP=%%~fA"
IF "%~1"=="-mp3" SET ext=MP3
IF "%~1"=="-aac" SET ext=AAC
IF "%~1"=="-skip" SET skip=yes
IF "%~2"=="-mp3" SET ext=MP3
IF "%~2"=="-aac" SET ext=AAC
IF "%~2"=="-skip" SET skip=yes
SET "source=%~3"
IF "%~3"=="" IF NOT "%~2"=="-skip" IF NOT "%~2"=="-mp3" IF NOT "%~2"=="-aac" SET "source=%~2"
IF "%~2"=="" IF NOT "%~1"=="-skip" IF NOT "%~1"=="-mp3" IF NOT "%~1"=="-aac" SET "source=%~1"
IF NOT EXIST "lame.exe" ECHO ^(^(.::^>-{ FLAC Converter }-^<::.^)^)
IF NOT EXIST "lame.exe" ECHO(
IF NOT EXIST "%~dp0QTfiles64\" MKDIR "%~dp0QTfiles64\"
IF NOT EXIST "lame.exe" powershell -command "Start-BitsTransfer -Source https://www.rarewares.org/files/mp3/lame3.100.1-x64.zip -Destination lame3.100.1-x64.zip" && powershell -command "Expand-Archive lame3.100.1-x64.zip '%~dp0'" && DEL lame3.100.1-x64.zip
IF NOT EXIST "flac.exe" powershell -command "Start-BitsTransfer -Source https://www.rarewares.org/files/lossless/flac-1.3.4-x64.zip -Destination flac-1.3.4-x64.zip" && powershell -command "Expand-Archive flac-1.3.4-x64.zip '%~dp0'" && DEL flac-1.3.4-x64.zip
IF NOT EXIST "qaac64.exe" powershell -command "Start-BitsTransfer -Source https://github.com/nu774/qaac/releases/download/2.73/qaac_2.73.zip -Destination qaac_2.73.zip" && powershell -command "Expand-Archive qaac_2.73.zip '%~dp0'" && DEL qaac_2.73.zip & MOVE "%~dp0qaac_2.73\x64\*.*" "%~dp0" && rd /s /q "%~dp0qaac_2.73"
IF NOT EXIST "%~dp0QTfiles64\libFLAC_dynamic.dll" powershell -command "Start-BitsTransfer -Source https://www.rarewares.org/files/lossless/flac_dll-1.3.4-x64.zip -Destination '%~dp0QTfiles64\flac_dll-1.3.4-x64.zip'" && powershell -command "Expand-Archive QTfiles64\flac_dll-1.3.4-x64.zip QTfiles64" && DEL QTfiles64\flac_dll-1.3.4-x64.zip
IF NOT EXIST "%~dp0QTfiles64\CoreAudioToolbox.dll" powershell -command "Start-BitsTransfer -Source https://github.com/AnimMouse/QTFiles/releases/download/v12.10.11/QTfiles64.7z -Destination '%~dp0QTfiles64\QTfiles64.7z'" && IF EXIST "%PROGRAMFILES%\7-zip\7z.exe" "%PROGRAMFILES%\7-Zip\7z.exe" x "%~dp0QTfiles64\QTfiles64.7z" -o"%~dp0QTfiles64\" && DEL QTfiles64\QTfiles64.7z
IF NOT EXIST "%~dp0QTfiles64\CoreAudioToolbox.dll" FOR /F "usebackq" %%C IN (`powershell -Command "Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.MessageBox]::Show( ( 'Installation Failed.{0}Please install 7-zip or extract the contents of{0}%~dp0QTfiles64\QTfiles64.7z{0}to{0}%~dp0QTfiles64\{0}before proceeding.'-f [char]0x0D ), '((.::>-{ FLAC Converter }-<::.))', [System.Windows.Forms.MessageBoxButtons]::RetryCancel, [System.Windows.Forms.MessageBoxIcon]::Exclamation, [System.Windows.Forms.MessageBoxDefaultButton]::Button1, [System.Windows.Forms.MessageBoxOptions]::ServiceNotification )"`) DO SET Answer=%%C
IF NOT EXIST "%~dp0QTfiles64\CoreAudioToolbox.dll" IF "%Answer%"=="Retry" IF EXIST "%PROGRAMFILES%\7-zip\7z.exe" "%PROGRAMFILES%\7-Zip\7z.exe" x "%~dp0QTfiles64\QTfiles64.7z" -o"%~dp0QTfiles64\" && DEL QTfiles64\QTfiles64.7z
IF NOT EXIST "%~dp0QTfiles64\CoreAudioToolbox.dll" EXIT
IF "%~1"=="" (
powershell -noprofile -Command "$WshShell=New-Object -comObject WScript.Shell; $Shortcut=$WshShell.CreateShortcut('%DP%\FLAC2MP3.lnk'); $Shortcut.TargetPath='%~f0'; $Shortcut.Arguments='-mp3'; $Shortcut.WorkingDirectory='%~dp0'; $Shortcut.Description='((.::>-{ FLAC Converter }-<::.))'; $Shortcut.IconLocation='%systemroot%\system32\shell32.dll, 85'; $Shortcut.Save();"
powershell -noprofile -Command "$WshShell=New-Object -comObject WScript.Shell; $Shortcut=$WshShell.CreateShortcut('%DP%\FLAC2MP3 -skip.lnk'); $Shortcut.TargetPath='%~f0'; $Shortcut.Arguments='-mp3 -skip'; $Shortcut.WorkingDirectory='%~dp0'; $Shortcut.Description='((.::>-{ FLAC Converter }-<::.))'; $Shortcut.IconLocation='%systemroot%\system32\shell32.dll, 85'; $Shortcut.Save();"
powershell -noprofile -Command "$WshShell=New-Object -comObject WScript.Shell; $Shortcut=$WshShell.CreateShortcut('%DP%\FLAC2AAC.lnk'); $Shortcut.TargetPath='%~f0'; $Shortcut.Arguments='-aac'; $Shortcut.WorkingDirectory='%~dp0'; $Shortcut.Description='((.::>-{ FLAC Converter }-<::.))'; $Shortcut.IconLocation='%systemroot%\system32\shell32.dll, 85'; $Shortcut.Save();"
powershell -noprofile -Command "$WshShell=New-Object -comObject WScript.Shell; $Shortcut=$WshShell.CreateShortcut('%DP%\FLAC2AAC -skip.lnk'); $Shortcut.TargetPath='%~f0'; $Shortcut.Arguments='-aac -skip'; $Shortcut.WorkingDirectory='%~dp0'; $Shortcut.Description='((.::>-{ FLAC Converter }-<::.))'; $Shortcut.IconLocation='%systemroot%\system32\shell32.dll, 85'; $Shortcut.Save();"
)
IF "%source%"=="" (
CLS
ECHO ^(^(.::^>-{ FLAC Converter }-^<::.^)^)
ECHO(
ECHO Select folder containing FLAC files:
ECHO(
FOR /F "usebackq delims=" %%S IN (`powershell -noprofile -Command "&{[System.Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms')|Out-Null; $FolderBrowserDialog=New-Object System.Windows.Forms.FolderBrowserDialog; $FolderBrowserDialog.RootFolder='MyComputer'; $FolderBrowserDialog.ShowNewFolderButton=$false; $FolderBrowserDialog.Description='Select a folder containing FLAC files to convert.'; $FolderBrowserDialog.ShowDialog()|Out-Null; $FolderBrowserDialog.SelectedPath}"`) DO SET "source=%%S"
)
SET "source=%source:"=%"
IF "%ext%"=="" (
CLS
ECHO ^(^(.::^>-{ FLAC Converter }-^<::.^)^)
ECHO(
CHOICE /C 12 /M "Select a format for conversion: [MP3/AAC]"
IF ERRORLEVEL 2 SET ext=AAC
IF ERRORLEVEL 1 SET ext=MP3
)
FOR /F "delims=" %%A IN ("%source%\..") DO SET "SP=%%~fA\"
IF NOT EXIST "%DP%\destination.txt" (
ECHO. 2>"%DP%\destination.txt"
CLS
ECHO ^(^(.::^>-{ FLAC Converter }-^<::.^)^)
ECHO(
ECHO Select a destination folder or select Cancel to auto select.
ECHO ^(To change folder in future, edit %DP%\destination.txt^):
FOR /F "usebackq delims=" %%D IN (`powershell -noprofile -Command "&{[System.Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms')|Out-Null; $FolderBrowserDialog=New-Object System.Windows.Forms.FolderBrowserDialog; $FolderBrowserDialog.RootFolder='MyComputer'; $FolderBrowserDialog.ShowNewFolderButton=$true; $FolderBrowserDialog.Description='Select a destination folder or select Cancel to auto select.'; $FolderBrowserDialog.ShowDialog()|Out-Null; $FolderBrowserDialog.SelectedPath}"`) DO ECHO %%D>"%DP%\destination.txt"
)
IF EXIST "%DP%\destination.txt" FOR /f "delims=" %%x IN (%DP%\destination.txt) DO SET DF=%%x
IF NOT "%DF%"=="" SET "DF=%DF%\%ext%"
IF "%DF%"=="" SET "DF=%SP:\\=\%%ext%"
powershell -Command "[void] [System.Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms'); $objNotifyIcon=New-Object System.Windows.Forms.NotifyIcon; $objNotifyIcon.BalloonTipText='Converting "%source%\"'; $objNotifyIcon.Icon=[system.drawing.systemicons]::Information; $objNotifyIcon.BalloonTipTitle='((.::>-{ FLAC Converter }-<::.))'; $objNotifyIcon.BalloonTipIcon='Info'; $objNotifyIcon.Visible=$True; $objNotifyIcon.ShowBalloonTip(5000);"
IF NOT EXIST "%DP%\logs\" MKDIR "%DP%\logs\"
FOR /F "usebackq tokens=1,2 delims==" %%i IN (`wmic os get LocalDateTime /VALUE 2^>NUL`) DO IF '.%%i.'=='.LocalDateTime.' SET ldt=%%j
SET ldt2=%ldt:~8,2%:%ldt:~10,2%:%ldt:~12,2%
SET ldt1=%ldt:~0,4%-%ldt:~4,2%-%ldt:~6,2%_%ldt:~8,2%%ldt:~10,2%%ldt:~12,2%
ECHO ^(^(.::^>-{ FLAC Converter }-^<::.^)^)>>"%DP%\logs\%ldt1%.log"
ECHO(>>"%DP%\logs\%ldt1%.log"
ECHO(>>"%DP%\logs\%ldt1%.log"
ECHO %ldt2% %~nx0 "%source%">>"%DP%\logs\%ldt1%.log"
ECHO(>>"%DP%\logs\%ldt1%.log"
ECHO(>>"%DP%\logs\%ldt1%.log"
FOR /R "%source%\" %%f IN ("*.flac") DO (
SET "file=%%f"
SET "folder=%%~dpf"
FOR /F "delims== tokens=1-2 USEBACKQ" %%m IN (`metaflac.exe --show-tag=ARTIST "%%f"`) DO SET "tag1=%%n"
FOR /F "delims== tokens=1-2 USEBACKQ" %%m IN (`metaflac.exe --show-tag=TITLE "%%f"`) DO SET "tag2=%%n"
FOR /F "delims== tokens=1-2 USEBACKQ" %%m IN (`metaflac.exe --show-tag=GENRE "%%f"`) DO SET "tag3=%%n"
FOR /F "delims== tokens=1-2 USEBACKQ" %%m IN (`metaflac.exe --show-tag=COMPILATION "%%f"`) DO SET "tag4=%%n"
FOR /F "delims== tokens=1-2 USEBACKQ" %%m IN (`metaflac.exe --show-tag=ALBUMARTIST "%%f"`) DO SET "tag5=%%n"
FOR /F "delims== tokens=1-2 USEBACKQ" %%m IN (`metaflac.exe --show-tag="ALBUM ARTIST" "%%f"`) DO SET "tag6=%%n"
FOR /F "delims== tokens=1-2 USEBACKQ" %%m IN (`metaflac.exe --show-tag=ALBUM "%%f"`) DO SET "tag7=%%n"
FOR /F "delims== tokens=1-2 USEBACKQ" %%m IN (`metaflac.exe --show-tag=DATE "%%f"`) DO SET "tag8=%%n"
FOR /F "delims== tokens=1-2 USEBACKQ" %%m IN (`metaflac.exe --show-tag=YEAR "%%f"`) DO SET "tag9=%%n"
FOR /F "delims== tokens=1-2 USEBACKQ" %%m IN (`metaflac.exe --show-tag=DISCNUMBER "%%f"`) DO SET "tag10=%%n"
FOR /F "delims== tokens=1-2 USEBACKQ" %%m IN (`metaflac.exe --show-tag=TOTALDISCS "%%f"`) DO SET "tag11=%%n"
FOR /F "delims== tokens=1-2 USEBACKQ" %%m IN (`metaflac.exe --show-tag=DISCTOTAL "%%f"`) DO SET "tag12=%%n"
FOR /F "delims== tokens=1-2 USEBACKQ" %%m IN (`metaflac.exe --show-tag=TRACKNUMBER "%%f"`) DO SET "tag13=%%n"
FOR /F "delims== tokens=1-2 USEBACKQ" %%m IN (`metaflac.exe --show-tag=TOTALTRACKS "%%f"`) DO SET "tag14=%%n"
FOR /F "delims== tokens=1-2 USEBACKQ" %%m IN (`metaflac.exe --show-tag=TRACKTOTAL "%%f"`) DO SET "tag15=%%n"
FOR /F "delims== tokens=1-2 USEBACKQ" %%m IN (`metaflac.exe --show-tag=ORGANIZATION "%%f"`) DO SET "tag16=%%n"
FOR /F "delims== tokens=1-2 USEBACKQ" %%m IN (`metaflac.exe --show-tag=PUBLISHER "%%f"`) DO SET "tag17=%%n"
FOR /F "delims== tokens=1-2 USEBACKQ" %%m IN (`metaflac.exe --show-tag=COMPOSER "%%f"`) DO SET "tag18=%%n"
FOR /F "delims== tokens=1-2 USEBACKQ" %%m IN (`metaflac.exe --show-tag=PERFORMER "%%f"`) DO SET "tag19=%%n"
FOR /F "delims== tokens=1-2 USEBACKQ" %%m IN (`metaflac.exe --show-tag=CONDUCTOR "%%f"`) DO SET "tag20=%%n"
FOR /F "delims== tokens=1-2 USEBACKQ" %%m IN (`metaflac.exe --show-tag=BPM "%%f"`) DO SET "tag21=%%n"
FOR /F "delims== tokens=1-2 USEBACKQ" %%m IN (`metaflac.exe --show-tag=INITIALKEY "%%f"`) DO SET "tag22=%%n"
FOR /F "delims== tokens=1-2 USEBACKQ" %%m IN (`metaflac.exe --show-tag=LABEL "%%f"`) DO SET "tag23=%%n"
FOR /F "delims== tokens=1-2 USEBACKQ" %%m IN (`metaflac.exe --show-tag=TRACK "%%f"`) DO SET "tag24=%%n"
FOR /F "delims== tokens=1-2 USEBACKQ" %%m IN (`metaflac.exe --show-tag=DISC "%%f"`) DO SET "tag25=%%n"
FOR /F "delims== tokens=1-2 USEBACKQ" %%m IN (`metaflac.exe --show-tag=DESCRIPTION "%%f"`) DO SET "tag26=%%n"
FOR /F "delims== tokens=1-2 USEBACKQ" %%m IN (`metaflac.exe --show-tag=COMMENT "%%f"`) DO SET "tag27=%%n"
FOR /F "delims== tokens=1-2 USEBACKQ" %%m IN (`metaflac.exe --show-tag=COMMENTS "%%f"`) DO SET "tag28=%%n"
FOR /F "delims== tokens=1-2 USEBACKQ" %%m IN (`metaflac.exe --show-tag=LABELNO "%%f"`) DO SET "tag29=%%n"
FOR /F "delims== tokens=1-2 USEBACKQ" %%m IN (`metaflac.exe --show-tag=CATALOGUENUMBER "%%f"`) DO SET "tag30=%%n"
FOR /F "delims== tokens=1-2 USEBACKQ" %%m IN (`metaflac.exe --show-tag=ISRC "%%f"`) DO SET "tag31=%%n"
FOR /F "delims== tokens=1-2 USEBACKQ" %%m IN (`metaflac.exe --show-tag=COPYRIGHT "%%f"`) DO SET "tag32=%%n"
SETLOCAL EnableDelayedExpansion
IF "!tag5!"=="" SET "tag5=!tag6!"
IF "!tag5!"=="" SET "tag5=!tag19!"
IF "!tag5!"=="" SET "tag5=!tag1!"
IF "!tag17!"=="" SET "tag17=!tag23!"
IF "!tag17!"=="" SET "tag17=!tag16!"
IF NOT "!tag8!"=="" SET "tag8=!tag8:-=!"
IF NOT "!tag8!"=="" SET "tyear=!tag8:~0,4!"
IF NOT "!tag8!"=="" SET "tmonth=!tag8:~4,2!"
IF NOT "!tag8!"=="" SET "tday=!tag8:~6,2!"
IF "!tag9!"=="" SET "tag9=!tyear!"
IF "!tag10!"=="" SET "tag10=!tag25!"
IF "!tag13!"=="" SET "tag13=!tag24!"
IF "!tag11!"=="" SET "tag11=!tag12!"
IF "!tag14!"=="" SET "tag14=!tag15!"
IF "!tag26!"=="" SET "tag26=!tag27!"
IF "!tag26!"=="" SET "tag26=!tag28!"
IF "!tag29!"=="" SET "tag29=!tag30!"
IF "!tag4!"=="1" SET "iscomp=--compilation "
FOR /f "delims=/ tokens=1-2" %%a IN ("!tag13!") DO (
SET tag13=%%a
IF NOT "%%b"=="" SET tag14=%%b
IF NOT "!tag14!"=="" SET "tag14=/!tag14!"
)
FOR /f "delims=/ tokens=1-2" %%a IN ("!tag10!") DO (
IF NOT "%%a"=="" SET tag10=%%a
IF NOT "%%b"=="" SET tag11=%%b
IF NOT "!tag11!"=="" SET "tag11=/!tag11!"
)
SET tracknr2=00!tag13!
SET tracknr2=!tracknr2:~-2!
IF NOT "!tag9!"=="" SET "adate= ^(!tag9!^)"
IF NOT "!tag10!"=="" SET "disc=\Disc !tag10!"
IF NOT "!tag10!"=="" SET "ndisc= [Disc !tag10!]"
IF NOT "!tag29!"=="" SET "catano=[!tag29!] "
IF "!tag5!"=="!tag5:Various=!" SET "dest2=!DF!\!tag5!\!tag7!!adate!!disc!"
IF NOT "!tag5!"=="!tag5:Various=!" SET "dest2=!DF!\Various Artists\!tag7!!adate!!disc!"
SET "dest2=!dest2: / =, !"
SET "dest2=!dest2:/=, !"
SET "dest2=!dest2:?=!"
SET "dest2=!dest2:: =, !"
SET "dest2=!dest2:\\=\!"
IF NOT EXIST "!dest2!" MKDIR "!dest2!"
IF "!ext!"=="MP3" SET "dest=!dest2!\!tracknr2! !tag1! - !tag2!.mp3"
IF "!ext!"=="AAC" SET "dest=!dest2!\!tracknr2! !tag1! - !tag2!.m4a"
SET "dest=!dest: / =, !"
SET "dest=!dest:/=, !"
SET "dest=!dest:?=!"
SET "dest=!dest:: =, !"
SET "dest=!dest:\\=\!"
IF "!chk2!"=="!dest2!" SET "coverfile=!chk1!"
IF NOT "!chk2!"=="!dest2!" (
metaflac.exe --export-picture-to="!dest2!\Cover.png" "!file!"
IF EXIST "!dest2!\Cover.png" SET "coverfile=!dest2!\Cover.png"
IF NOT "!skip!"=="yes" IF NOT EXIST "!dest2!\Cover.png" (
CLS
COLOR 0E
ECHO ^(^(.::^>-{ FLAC Converter }-^<::.^)^)
ECHO(
ECHO Getting Album Art for !tag5! - !catano!!tag7!!adate!!ndisc!...
ECHO There is no PICTURE block in the metadata.
ECHO Please input path of album art or leave blank to skip:
ECHO(
powershell -Command "[void] [System.Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms'); $objNotifyIcon=New-Object System.Windows.Forms.NotifyIcon; $objNotifyIcon.BalloonTipText='There is no PICTURE block in the metadata. Please input path of album art or leave blank to skip'; $objNotifyIcon.Icon=[system.drawing.systemicons]::Information; $objNotifyIcon.BalloonTipTitle='((.::>-{ FLAC Converter }-<::.))'; $objNotifyIcon.BalloonTipIcon='Warning'; $objNotifyIcon.Visible=$True; $objNotifyIcon.ShowBalloonTip(5000);"
FOR /f "usebackq delims=" %%L IN (`powershell -noprofile -Command "[System.Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms') | Out-Null; $OpenFileDialog=New-Object System.Windows.Forms.OpenFileDialog; $OpenFileDialog.InitialDirectory='!folder!'; $OpenFileDialog.Title='Select !tag5! - !catano!!tag7!!adate!!ndisc! Album Art'; $OpenFileDialog.Filter='Image Files (*.jpg,*.jpeg,*.png)|*.jpg;*.jpeg;*.png'; $OpenFileDialog.ShowDialog() | Out-Null; $OpenFileDialog.FileName;"`) DO SET "coverfile=%%L"
COLOR f9
)
IF NOT "!coverfile!"=="" SET "coverfile=!coverfile:"=!"
)
FOR /F "usebackq tokens=1,2 delims==" %%i IN (`wmic os get LocalDateTime /VALUE 2^>NUL`) DO IF '.%%i.'=='.LocalDateTime.' SET ldt=%%j
SET ldt2=!ldt:~8,2!:!ldt:~10,2!:!ldt:~12,2!
ECHO !ldt2! Converting "%%f"...>>!DP!\logs\!ldt1!.log
CLS
ECHO ^(^(.::^>-{ FLAC Converter }-^<::.^)^)
ECHO(
ECHO METADATA
ECHO(
ECHO [PUBLISHER]: !tag17! // [COMPILATION]: !tag4!
ECHO [ALBUM ARTIST]: !tag5! // [YEAR]: !tag9!
ECHO [ALBUM]: !tag7! // [PART OF SET]: !tag10!!tag11!
ECHO [ARTIST]: !tag1!
ECHO [TRACK NUMBER]: !tag13!!tag14! // [TITLE]: !tag2!
ECHO [GENRE]: !tag3! // [BPM]: !tag21! // [KEY]: !tag22! // [COMMENTS]: !tag26!
ECHO [COMPOSER]: !tag18! // [CONDUCTOR]: !tag20! // [PERFORMER]: !tag19!
ECHO [IMAGE]: !coverfile!
IF "!ext!"=="MP3" IF NOT EXIST "!dest!" flac.exe -cd "!file!" | lame.exe -b 320 --add-id3v2 --ignore-tag-errors --ti "!coverfile!" --ta "!tag1!" --tt "!tag2!" --tg "!tag3!" --tv "TCMP=!tag4!" --tv "TPE2=!tag5!" --tl "!tag7!" --ty "!tag9!" --tn "!tag13!!tag14!" --tv "TPOS=!tag10!!tag11!" --tv "TPUB=!tag17!" --tv "TCOM=!tag18!" --tv "TPE3=!tag20!" --tv "TSOP=!tag19!" --tv "TBPM=!tag21!" --tv "TKEY=!tag22!" --tc "!tag26!" - "!dest!" 2>> !DP!\logs\!ldt1!.log
IF "!ext!"=="AAC" IF NOT EXIST "!dest!" qaac64.exe --artwork "!coverfile!" --artist "!tag1!" --title "!tag2!" --genre "!tag3!" "!iscomp!"--band "!tag5!" --album "!tag7!" --date "!tag9!" --track "!tag13!!tag14!" --disk "!tag10!!tag11!" --composer "!tag18!" --comment "!tag26!" -v256 -o "!dest!" "!file!"
ECHO [PUBLISHER]: !tag17! // [COMPILATION]: !tag4!>>"!DP!\logs\!ldt1!.log"
ECHO [ALBUM ARTIST]: !tag5! // [YEAR]: !tag9!>>"!DP!\logs\!ldt1!.log"
ECHO [ALBUM]: !tag7! // [PART OF SET]: !tag10!!tag11!>>"!DP!\logs\!ldt1!.log"
ECHO [ARTIST]: !tag1!>>"!DP!\logs\!ldt1!.log"
ECHO [TRACK NUMBER]: !tag13!!tag14! // [TITLE]: !tag2!>>"!DP!\logs\!ldt1!.log"
ECHO [GENRE]: !tag3! // [BPM]: !tag21! // [KEY]: !tag22! // [COMMENTS]: !tag26!>>"!DP!\logs\!ldt1!.log"
ECHO [COMPOSER]: !tag18! // [CONDUCTOR]: !tag20! // [PERFORMER]: !tag19!>>"!DP!\logs\!ldt1!.log"
ECHO [IMAGE]: !coverfile!>>"!DP!\logs\!ldt1!.log"
FOR /F "usebackq tokens=1,2 delims==" %%i IN (`wmic os get LocalDateTime /VALUE 2^>NUL`) DO IF '.%%i.'=='.LocalDateTime.' SET ldt=%%j
SET ldt2=!ldt:~8,2!:!ldt:~10,2!:!ldt:~12,2!
ECHO !ldt2! !dest!>>!DP!\logs\!ldt1!.log
ECHO(>>"!DP!\logs\!ldt1!.log"
FOR /f "delims=" %%x IN (""!coverfile!"") DO (
FOR /f "delims=" %%y IN (""!dest2!"") DO (
ENDLOCAL
SET "tag1="
SET "tag2="
SET "tag3="
SET "tag4="
SET "tag5="
SET "tag6="
SET "tag7="
SET "tag8="
SET "tag9="
SET "tag10="
SET "tag11="
SET "tag12="
SET "tag13="
SET "tag14="
SET "tag15="
SET "tag16="
SET "tag17="
SET "tag18="
SET "tag19="
SET "tag20="
SET "tag21="
SET "tag22="
SET "tag23="
SET "tag24="
SET "tag25="
SET "tag26="
SET "tag27="
SET "tag28="
SET "tracknr2="
SET "adate="
SET "disc="
SET "dest="
SET "dest2="
SET "tyear="
SET "tmonth="
SET "tday="
SET "iscomp="
SET "coverfile="
SET "chk1=%%~x"
SET "chk2=%%~y"
)
)
)
powershell -Command "[void] [System.Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms'); $objNotifyIcon=New-Object System.Windows.Forms.NotifyIcon; $objNotifyIcon.BalloonTipText='Conversion from "%source%\" finished.'; $objNotifyIcon.Icon=[system.drawing.systemicons]::Information; $objNotifyIcon.BalloonTipTitle='((.::>-{ FLAC Converter }-<::.))'; $objNotifyIcon.BalloonTipIcon='Info'; $objNotifyIcon.Visible=$True; $objNotifyIcon.ShowBalloonTip(5000);"
FOR /F "usebackq" %%C IN (`powershell -Command "Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.MessageBox]::Show( ( 'Conversion from {0}"%source%\"{0}to{0}"%DF%"{0}Complete!{0}Would you like to view the logfile and destination folder?'-f [char]0x0D ), '((.::>-{ FLAC Converter }-<::.))', [System.Windows.Forms.MessageBoxButtons]::YesNo, [System.Windows.Forms.MessageBoxIcon]::Information, [System.Windows.Forms.MessageBoxDefaultButton]::Button1, [System.Windows.Forms.MessageBoxOptions]::ServiceNotification )"`) DO SET lastq=%%C
IF "%lastq%"=="Yes" START "" explorer.exe "%DF%\" & START "" notepad.exe "%DP%\logs\%ldt1%.log"
EXIT