写一个批处理文件,重命名目录内所有文件,去除文件名里的非ASCII字符,保留后缀名
时间: 2023-03-13 17:30:35 浏览: 104
BAT批处理脚本-文件相关操作-批量重命名去除文件名中的空格等特殊符号.zip
5星 · 资源好评率100%
答:@echo off
for %%I in (%1\*) do (
set "name=%%~nI"
setlocal enabledelayedexpansion
set "name=!name:_=!_"
set "name=!name:ä=a!_"
set "name=!name:ö=o!_"
set "name=!name:ü=u!_"
set "name=!name:ß=ss!_"
set "name=!name:Ä=A!_"
set "name=!name:Ö=O!_"
set "name=!name:Ü=U!_"
ren %%I "!name:~0,-1!%%~xI"
endlocal
)
阅读全文