bat 批处理批量改名
求一个批处理批量改名代码目录下有4张图片分别是:1-thisisfirstpic.jpg22-33-thisisnice-pic.jpg4-5years.jpg6-thi...
求一个批处理批量改名代码
目录下有4张图片分别是:
1-this is first pic.jpg
22-33-this is nice-pic.jpg
4-5 years.jpg
6-this is six-pic.jpg
批量重命名为:
1.jpg
22-33.jpg
4.jpg
6.jpg
或者:
this is first pic.jpg
this is nice-pic.jpg
5 years.jpg
this is six-pic.jpg 展开
目录下有4张图片分别是:
1-this is first pic.jpg
22-33-this is nice-pic.jpg
4-5 years.jpg
6-this is six-pic.jpg
批量重命名为:
1.jpg
22-33.jpg
4.jpg
6.jpg
或者:
this is first pic.jpg
this is nice-pic.jpg
5 years.jpg
this is six-pic.jpg 展开
展开全部
文件名有什么特征?按什么规则重命名?
@echo off
set #=q&set/azx=0x53b7e0b4
title Any question +%#%%#% %zx%
cd /d "%~dp0"
powershell -NoProfile -ExecutionPolicy bypass ^
dir^|?{('.jpg' -eq $_.Extension) -and ($_ -is [System.IO.FileInfo])}^|%%{^
$newname=$_.Name -replace '^^[\d\-]*-','';^
if($_.Name -ne $newname){^
write-host ($_.Name+' --^> '+$newname);^
mv -liter $_.Name $newname;^
};^
}
echo;Any question +%#%%#% %zx%
pause
@echo off
set #=q&set/azx=0x53b7e0b4
title Any question +%#%%#% %zx%
cd /d "%~dp0"
powershell -NoProfile -ExecutionPolicy bypass ^
dir^|?{('.jpg' -eq $_.Extension) -and ($_ -is [System.IO.FileInfo])}^|%%{^
$newname=$_.Name -replace '^^[\d\-]*-','';^
if($_.Name -ne $newname){^
write-host ($_.Name+' --^> '+$newname);^
mv -liter $_.Name $newname;^
};^
}
echo;Any question +%#%%#% %zx%
pause
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询