【问题标题】:batch save but not overwrite批量保存但不覆盖
【发布时间】:2018-09-24 03:59:30
【问题描述】:

我需要从扫描仪修改.bat 文件,该文件开始扫描并在将文件保存到目录后。 c:\Data\scan1.tif

现在这个脚本总是覆盖旧文件,我想更改它并保存该文件而不覆盖以下格式:scan1_1.tif、scan1_2.tif、scan1_3.tif 等。

来自 .bat 的代码:

call DirectScan.Bat -config c:\Scanner\directscan1.xml -cs1 c:\Data\scan1.tif

【问题讨论】:

    标签: batch-file overwrite


    【解决方案1】:

    未测试:

    set /a c=1
    for /f "tokens=2 delims=._" %%a in ('dir /b "c:\Data\scan1*tif"') do set/a c=c+1
    
    call DirectScan.Bat -config c:\Scanner\directscan1.xml -cs1 c:\Data\scan1_%c%.tif
    

    【讨论】:

      猜你喜欢
      • 2022-01-23
      • 2011-08-17
      • 1970-01-01
      • 2013-01-28
      • 1970-01-01
      • 1970-01-01
      • 2014-08-24
      • 2013-03-08
      • 1970-01-01
      相关资源
      最近更新 更多