[英]Why does this REN command return “The syntax of the command is incorrect”?
我在一个文件夹中有一些文件,例如:
- 快乐之歌.m4a.mp3
- 悲伤的歌曲 ft. HER.m4a.mp3
我想将这些重命名为:
- 快乐之歌.mp3
- 悲伤的歌曲 ft. HER.mp3
这是我放置在同一文件夹中的test.bat
文件的代码:
for /f "delims=" %%a in ('dir /b /a-d *.m4a.mp3') do (
set "oldName=%%~a"
set "newName=%oldName:.m4a=%"
ren %%a "%newName%"
)
它返回The syntax of the command is incorrect.
我试过了:
for /f "delims=" %%a in ('dir /b /a-d *.m4a.mp3') do (
set "oldName=%%~a"
set "newName=%oldName:.m4a=%"
ren %%a %newName%
)
返回ft. was unexpected at this time.
我在这里做错了什么?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.