当前位置:网站首页>批量修改指定字符文件名 bat脚本
批量修改指定字符文件名 bat脚本
2022-06-28 16:24:00 【flymore96】
@echo off
set /p str1= 请输入要替换的文件(文件夹)名字符串(可替换空格):
set /p str2= 请输入替换后的文件(文件夹)名字符串(若删除直接回车):
echo.
echo 正在操作中,请稍候……
for /f "delims=" %%a in ('dir /s /b ^|sort /+65535') do (
if "%%~nxa" neq "%~nx0" (
set "file=%%a"
set "name=%%~na"
set "extension=%%~xa"
call set "name=%%name:%str1%=%str2%%%"
setlocal enabledelayedexpansion
ren "!file!" "!name!!extension!" 2>nul
endlocal
)
)
exit
直接在要修改的文件下创建.bat文件,将上面代码放到文件中即可,双击执行。
转载:https://blog.csdn.net/weixin_43042683/article/details/108453639
实测 可行。
边栏推荐
- Design details of the full stack CRM development tool webclient UI workbench
- Traffic management and control of firewall Foundation
- NOIP2011-2018提高组解题报告
- Stm32cubemx usage and function introduction
- LDD 知识整理
- China energy integration and Tianyi cloud create an "energy brain"
- 岛屿类问题通用解法与DFS框架
- Can SQL queries be used in the tablestore to find out all the data in the table?
- Media data processing V2 Version (VPC) image zoom content analysis
- Mysql自連接查詢「建議收藏」
猜你喜欢
【Hot100】4. 寻找两个正序数组的中位数
[golang] how to install iris
AI落地的新范式,就“藏”在下一场软件基础设施的重大升级里
After the first failure, AMEC rushed to the Hong Kong stock exchange for the second time, and the financial principal changed frequently
Noip popularization group 2006-2018 preliminary round 2019 csp-j1 2020 csp-j1 improvement program
基数排序——【常见排序法(2/8)】
[tcapulusdb knowledge base] Introduction to tcapulusdb restrictions
10.hystrix circuit breaker
The first place on the list - brake by wire "new cycle", the market competitiveness of local suppliers is TOP10
FS2K人脸素描属性识别
随机推荐
QQ出现大规模盗号,为什么会这样?就没有解决方法了吗?
LDD knowledge sorting
Kiss in the metauniverse! CMU launched VR head display plug-in, reproducing the vivid touch of lips
【Hot100】3. 无重复字符的最长子串
Knowing these commands allows you to master shell's own tools
NOIP1998-2018年普及组 CSP-J2 2019 2020 解题报告及视频
QQ appears large-scale number theft, why is this? Is there no solution?
Azure Kinect Microsoft camera unity development summary
【Hot100】4. 寻找两个正序数组的中位数
Briefly introduce the conversion between tensorflow and pytorch (mainly tensorflow to pytorch)
数字藏品热潮之下,你必须知道的那些事儿
昨日元宇宙|Meta “元宇宙”部门一季度亏损29.6亿美元,六福珠宝发行数字藏品
Cross cluster deployment of helm applications using karmada
Introduction to reverse commissioning PE structure details 02/07
PID control details [easy to understand]
A 24-year-old bald programmer teaches you how to continuously integrate and deliver microservice delivery. You can't learn how to cut me off
【Hot100】4. Find the median of two positive arrays
Noip2011-2018 problem solving report of improvement group
【尚硅谷与腾讯云官方合作】硅谷课堂项目视频发布
[golang] how to install iris