Batch file 在批处理脚本中将creplace@替换为我的forder路径中的%40

Batch file 在批处理脚本中将creplace@替换为我的forder路径中的%40,batch-file,cmd,Batch File,Cmd,我需要将福特路径中的@替换为%40: @ECHO OFF set filepath= x:\Test\Test\Test\Test\@Test\@Test\@Test\@Test\Test\Test.mov set string=%filepath% set string=%string:@=%40% set folder=%string% echo %folder% pause 我需要: 像这样,;有谁能帮我解决这个问题吗?在这种情况下,延迟的扩展很方便,因为您使用的是批处理文件,%需要

我需要将福特路径中的
@
替换为
%40

@ECHO OFF
set filepath= x:\Test\Test\Test\Test\@Test\@Test\@Test\@Test\Test\Test.mov

set string=%filepath%
set string=%string:@=%40%

set folder=%string%
echo %folder%
pause
我需要:


像这样,;有谁能帮我解决这个问题吗?

在这种情况下,延迟的扩展很方便,因为您使用的是批处理文件,
%
需要加倍

@Echo关闭
设置“filepath=x:\Test\Test\Test\Test\@Test\@Test\@Test\@Test\Test\Test.mov”
SetLocal EnableDelayedExpansion
设置“文件夹=!文件路径:@=%%40!”!
EndLocal&回显%folder%
暂停
x:\Test\Test\Test\Test\@Test\@Test\@Test\@Test\Test\Test.mov
x:\Test\Test\Test\Test\%40Test\%40Test\%40Test\%40Test\Test\Test.mov