Windows 8 在目录中合并视频的批处理脚本

Windows 8 在目录中合并视频的批处理脚本,windows-8,batch-file,Windows 8,Batch File,我需要一个批处理脚本来列出.avi |.mp4并对包含此类文件的所有目录运行命令: mencoder.exe <some_arguments> -o "output/(name_of_directory).mp4" <list_of_files_in_directory_spearated_by_spaces_evey_file_quoted> mencoder.exe-o“输出/(目录的名称).mp4” 有人能帮我吗?有可能吗 我用PHP编写了一个脚本,用Bamco

我需要一个批处理脚本来列出.avi |.mp4并对包含此类文件的所有目录运行命令:

mencoder.exe <some_arguments> -o "output/(name_of_directory).mp4" <list_of_files_in_directory_spearated_by_spaces_evey_file_quoted>
mencoder.exe-o“输出/(目录的名称).mp4”
有人能帮我吗?有可能吗

我用PHP编写了一个脚本,用Bamcomile编译,但在Windows 8上它的行为似乎完全不同,数组正在转换为字符串,而且发生了一些非常奇怪的事情…

试试这个:

@echo off &setlocal
cd /d "%userprofile%\Videos"
for /f "tokens=1*delims=:" %%a in ('dir /b /a-d *.avi *.mp4^|findstr /n $') do set "$%%a=%%~b"

setlocal enabledelayedexpansion
for /f "tokens=1*delims==" %%a in ('set "$" 2^>nul') do set "line=!line! "%%~b""

echo mencoder.exe [some_arguments] -o "output/(name_of_directory).mp4" %line%

查看输出,如果看起来不错,则删除回声。

查看这是否会使您的船漂浮<代码>字符在路径和文件名中是冗余的

@echo off
setlocal enabledelayedexpansion
cd /d "%userprofile%\Videos"
for /f "delims=" %%a in ('dir /s /b /a-d *.avi *.mp4') do (
   for /f "delims=" %%b in ("%%~dpa.") do (
        set "line="
        for %%c in ("%%~dpa*.*") do set line=!line! "%%c"
        echo mencoder.exe [some_arguments] -o "output\%%~nxb.mp4" !line!
        pause
   )
)

(目录的名称
)没有改变,通常什么也没有发生,它说
找不到文件
。。。它是递归的吗?文件列表是否都需要完全限定的路径?