【问题标题】:Cannot pass BAT parameters to variable无法将 BAT 参数传递给变量
【发布时间】:2016-01-17 08:21:27
【问题描述】:

我在将参数传递给 BAT 文件中的变量时遇到问题:

@setlocal enableextensions enabledelayedexpansion 

if "%5" NEQ "" ( 
echo [%5][%6] //it displays normal parameters like 10 and 30 
set /a sstart=%~5 // was testing without /a, without ~, with $, in all combinations 
set /a sstop=%~6 
echo [%sstart%][%sstop%] // parameters are empty 
set sekstart=--start-at duration:%sstart% 
set /a sekstopr=%sstop% - %sstart% 
set sekstop=--stop-at duration:%sekstopr% 
echo Start: %sstart% Stop: %sekstop% 
) 

这是用于手刹中的编码: https://trac.handbrake.fr/wiki/CLIGuide

【问题讨论】:

标签: variables batch-file command-line parameters


【解决方案1】:

改变

if "%5" NEQ "" ( 

if "%5" == "" goto skip

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-11-18
    • 2015-01-05
    • 2018-06-20
    • 1970-01-01
    • 2021-07-28
    • 2015-07-07
    • 1970-01-01
    相关资源
    最近更新 更多