如何通过命令提示符从第6行启动批处理文件?
从批处理指定标签(跳过前置步骤)启动的方法
批处理没有原生的“指定行号启动”功能,但可以通过标签跳转+命令行参数或者临时调用批处理的方式实现跳过前置代码,直接从你需要的:Premiere部分开始执行。
方法一:修改原批处理,添加参数判断(推荐)
在原批处理开头加入参数判断逻辑,当运行时传入指定参数,直接跳转到:Premiere标签:
修改后的批处理代码:
@Echo off :: 若传入"skip"参数,直接跳转到Premiere标签 if "%~1"=="skip" goto :Premiere set /p IPath=Enter the Path of the file you wish to remux from (use "Copy as path" option and keep the Quotations): set /P M=what is the first letter of the path of your new file?(do not include the semicolon(:)) set /p NewPath=Enter the Path you wish to remux to (must be path minus the directory BUT do not use Quotations for this)(I also recommend using a single folder to hold the files while remuxing them before sending them to their separate folders): ffmpeg -i %IPath% -c copy -map 0 "%M%:\%NewPath%" goto :Premiere &:: This command takes inputs from the previous lines and sets up to remux files :Premiere &:: this command line starts the preferred editor and waits 30 seconds to allow it to start set /p EDITOR=Enter the .exe file for your prefered editor should look like: 'Adobe Premiere Pro.exe': start "" "%EDITOR%" echo Starting Process. . . Please Wait timeout /t 30 tasklist | find /I "%EDITOR%" &:: The next couple of lines test for the editor to see if it opened or not if errorlevel 1 ( echo could not start process goto :FailEditor ) Else ( echo Process completed, next question---> goto :choice )
之后在命令提示符中运行:
M:\REMUX.bat skip
即可直接跳过前面的输入和ffmpeg步骤,从:Premiere标签对应的代码开始执行。
方法二:不修改原批处理,用临时批处理调用
创建一个新的批处理文件(比如StartFromPremiere.bat),内容如下:
@echo off call M:\REMUX.bat :Premiere
运行这个新批处理,就能直接进入原批处理的:Premiere逻辑。
内容的提问来源于stack exchange,提问作者Voidmaster01
相关产品推荐
相关产品推荐

