Rename multiple files without parentheses/remove parentheses windows

后端 未结 4 1947
情深已故
情深已故 2021-02-06 03:03

I want to rename a large number of files in increasing order of numbers, starting from anywhere. But when I rename multiple files, it leaves me with parentheses. eg i rename f

4条回答
  •  礼貌的吻别
    2021-02-06 03:48

    To remove the brackets you will have to do some string manipulation. I have written a batch file to do this (save as .bat)

    cd C:\folder
    setlocal enabledelayedexpansion
    for %%a in (abc_*.jpeg) do (
    set f=%%a
    set f=!f:^(=!
    set f=!f:^)=!
    ren "%%a" "!f!"
    )
    

    I don't think you can easily do this in one line from the command line though, it may be possible but it won't be pretty. If you can help it use this batch file to remove the brackets.

提交回复
热议问题