我试图删除" .RETCH"从我的批处理脚本我的文件名 [英] I'm trying to remove " .RETCH " from my file names with my batch script
本文介绍了我试图删除" .RETCH"从我的批处理脚本我的文件名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我只是想有从文件名我现有的脚本中删除.RETCH。
恩。 B00TI8DTJY.RETCH.PT01.jpg - > B00TI8DTJY.PT01.jpg
我知道如何删除一定数量的字符或添加一些文件名,但无法弄清楚如何,只除去.RETCH一部分。
感谢。
解决方案
SETLOCAL enabledelayedexpansion
FOR / F %%一个在('DIR *干呕* / B')做(
设置名称= %%一个&放大器;设置!NAME =名称:.RETCH =!
仁%%一个!的名字!
)
刚上相同的目录文件运行此。如果它需要去的子目录再加入 / S
标志 DIR
命令。
I'm simply trying to have my existing script remove " .RETCH " from the file name.
ex. " B00TI8DTJY.RETCH.PT01.jpg --> B00TI8DTJY.PT01.jpg "
I know how to remove a certain amount of characters or add something to the file name but can't figure out how to Only remove the .RETCH part.
Thanks.
解决方案
setlocal enabledelayedexpansion
for /f %%a in ('dir *RETCH* /b') do (
set "name=%%a"&set "name=!name:.RETCH=!"
ren "%%a" "!name!"
)
Just run this on the same directory as your files. If it's needed to go on subdirectories then add /s
flag to dir
command.
这篇关于我试图删除" .RETCH"从我的批处理脚本我的文件名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文