Search code examples
windowsperlrenamefile-renamebatch-rename

How to use File-Rename aka Perl's rename in Windows?


There's tons of rename examples out there, but most of the time, these are for Unix/Linux users. What about if I want to use it using ?


Solution

  • First, go to https://strawberryperl.com/, then install the appropriate build (64 or 32 bits).

    Now you have Perl and some utilities, but not the rename command.

    To install it, open a cmd.exe terminal, then

    cpan File::Rename
    

    Now, the command is accessible.

    file-rename
    Usage:
        rename [ -h|-m|-V ] [ -v ] [ -0 ] [ -n ] [ -f ] [ -d ] [ -u [enc]]
        [ -e|-E perlexpr]*|perlexpr [ files ]
    

    A guide with some examples of using this utility: Perl's rename


    To use the quoting style of 'Linux' instead of "DOS", better use to use the rename command line with 'single quotes'.