---------
@echo off
cls
dir /b /a-d *.mp3 > temp.txt
if not exist temp.txt echo No Mp3 files found!
if not exist temp.txt pause
if not exist temp.txt exit
echo Temporary file has been created.
pause
rem -----------------------------------------------------
rem The following FOR statement must be one line, not two
rem (Beware of Blogger's word wrap.)
rem -----------------------------------------------------
FOR /F "usebackq tokens=1,2 delims=-" %%a in (temp.txt) DO call :process "%%a" "%%b"
rem -----------------------------------------------------
echo.
echo Alas, We Have Reached The End.
echo.
pause
exit
:process
set VAR1=%1
rem Trim quotes
for /f "useback tokens=*" %%a in ('%VAR1%') do set VAR1=%%~a
echo VAR1=%VAR1%
set VAR2=%2
rem Trim quotes
for /f "useback tokens=*" %%a in ('%VAR2%') do set VAR2=%%~a
echo VAR2=%VAR2%
set filename=%VAR1%- %VAR2%
echo %filename%
pause
goto :EOF
No comments:
Post a Comment