Rename or remove prefix for multiple files to each ones' number in Windows

前端 未结 3 1454
猫巷女王i
猫巷女王i 2021-01-31 05:05

I am trying to change all the files names in a current folder and I am trying to achieve this either by removing the files prefix (every file has a common prefix) or changing th

3条回答
  •  一整个雨季
    2021-01-31 05:32

    A much simpler solution is provided in
    https://superuser.com/a/871799/497147

    I copied it here for easier access.

    Forget about complicated scripts for this.

    rename is a very old and never properly completed command. If you do not use it properly, the result might surprise you.

    For example to remove a prefix abcd from abcd1.txt, abcd2.txt, abcd3.txt etc. in order to get 1.txt, 2.txt, 3.txt simply use

    rename "abcd*.txt" "////*.txt"
    

    You need the same number of / as the number of initial characters you would like to remove.

    Do place double quotes for both arguments.

提交回复
热议问题