【发布时间】: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
如果我在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
您可以使用字符串操作。像这样的东西;
@echo off
set str=asd\asd
set str=%str:\=/%
echo %str%
pause
请记住,如果您在 for 循环中工作,请确保您使用的是 setlocal EnableDelayedExpansion 并使用 !str! 而不是 %str% 访问您的变量
【讨论】: