以下脚本能正常收集mp4、mp3文件名单- set /p folder=
- for /f "delims=" %%a in ('dir /b/a-d/oN %folder%\*.mp4 %folder%\*.mp3') do (
- echo %%~na>> "%folder%"\%date:~5,2%-%date:~8,2%.txt
- echo %%~xa>> "%folder%"\%date:~5,2%-%date:~8,2%.txt
- for /f "tokens=1-2 delims=-" %%i in ("%%~na") do (echo %%j>> "%folder%"\纯歌名%date:~5,2%-%date:~8,2%.txt
- )
- ping -n 3 127.0.0.1 1>nul 2>nul
-
- cls
- @echo 已成功将 "%folder%" 音视频收集,文本位于该目录下的 "%date:~5,2%-%date:~8,2%.txt" 文档内
- goto :sss
复制代码 以下是加上if判断为mp3曲目后,变闪退。如何更正呢?目的是达到歌曲名为英文时,单独罗列出来,以便后续翻译用- set /p folder=
- for /f "delims=" %%a in ('dir /b/a-d/oN %folder%\*.mp4 %folder%\*.mp3') do (
- echo %%~na>> "%folder%"\%date:~5,2%-%date:~8,2%.txt
- echo %%~xa>> "%folder%"\%date:~5,2%-%date:~8,2%.txt
- if %%~xa=mp3 (for /f "tokens=1-2 delims=-" %%i in ("%%~na") do (echo %%j>> "%folder%"\纯歌名%date:~5,2%-%date:~8,2%.txt)
- )
- ping -n 3 127.0.0.1 1>nul 2>nul
-
- cls
- @echo 已成功将 "%folder%" 音视频收集,文本位于该目录下的 "%date:~5,2%-%date:~8,2%.txt" 文档内
- goto :sss
复制代码
|