我在文件夹中有一些文件,如:
我想把这些重新命名为:
下面是放置在同一个文件夹中的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.的
我在这里做错什么了?
发布于 2021-01-23 12:33:25
你也许可以在cmd上这样做
For %G In (*.m4a.mp3) Do @For %H In ("%~nG") Do @Ren "%G" "%~nH%~xG"或者像这样从一个批文件
@For %%G In (*.m4a.mp3) Do @For %%H In ("%%~nG") Do @Ren "%%G" "%%~nH%%~xG"https://stackoverflow.com/questions/65859003
复制相似问题