【问题标题】:Bath command file path formatBath命令文件路径格式
【发布时间】:2014-11-18 17:46:37
【问题描述】:

如果我在FOR 命令中使用%%~fI,它将返回以下格式的文件路径C:\Users\Girish\Pictures\03\302.jpg。是否有任何批处理命令以以下格式返回文件路径 file:///C:/Users/Girish/Pictures/03/test/302.jpg

【问题讨论】:

    标签: html batch-file batch-processing spring-batch-admin


    【解决方案1】:

    您可以使用字符串操作。像这样的东西;

    @echo off
    set str=asd\asd
    set str=%str:\=/%
    
    echo %str%
    pause
    

    请记住,如果您在 for 循环中工作,请确保您使用的是 setlocal EnableDelayedExpansion 并使用 !str! 而不是 %str% 访问您的变量

    【讨论】:

      猜你喜欢
      • 2013-08-27
      • 1970-01-01
      • 2016-01-13
      • 1970-01-01
      • 1970-01-01
      • 2011-02-08
      • 1970-01-01
      • 2012-04-07
      • 2014-04-12
      相关资源
      最近更新 更多