- @echo off
- for /f "delims=" %%f in ('dir /a:-d /b *.ksc') do (
- findstr /n .* "%%f" >.tmp
- set -DelContent=
- (for /f "delims=" %%a in (.tmp) do (
- set var=%%a
- if not defined -DelContent set -DelContent=. >.tmp
- SetLocal EnableDelayedExpansion
- if "!var:karaoke.tag('歌名=!" neq "!var!" >>.tmp echo 歌名=!var:*, '=!
- if "!var:karaoke.tag('歌手=!" neq "!var!" >>.tmp echo 歌手=!var:*, '=!
- if "!var:karaoke.CommonVideo :=!" neq "!var!" (
- EndLocal
- for /f "delims=" %%a in (.tmp) do set %%a
- SetLocal EnableDelayedExpansion
- >.tmp echo !歌手:~0,-3!-!歌名:~0,-3!
- echo karaoke.CommonVideo := '!歌手:~0,-3!-!歌名:~0,-3!.mpg';
- ) else echo,!var:*:=!
- EndLocal
- )) >"%%f"
- for /f "delims=" %%a in (.tmp) do (
- ren "%%f" "%%a.*"
- ren "%%~dpnf.mpg" "%%a.*"
- )
- )
-
- del .tmp
复制代码
[ 本帖最后由 tmplinshi 于 2011-1-24 21:06 编辑 ] |