> Latest version of windows come up with a batch rename feature, using this feature one can select multiple files, right click on one and rename them all after selecting rename. This batch rename feature has been found to be working out for basic files but it doesn’t provide flexibility and doesn’t change file extensions. Windows PowerShell has been included in Windows XP, windows 2008 Server and windows vista. PowerShell is a raw tool for carrying out batch file renames. Dir and rename-item are two PowerShell commands required for batch file renames, dir is an alias for get-childitem.

For carrying out this task you can copy all files you might be willing to rename in different directory and open Windows PowerShell. After that you can navigate to the directory using CD command. There are different techniques for renaming the files and you can use the one accordingly.

For changing File Extension of all .jpeg files to .jpg you can use below command:

Dir *.jpeg | rename-item -newname { $_.name -replace ".jpeg",".jpg" }

In above command $_ represents items which are passed to rename-item command via pipe | from dir command.

For appending a File Extension:

Dir | rename-item -newname { $_.Name +".jpg" }

For renaming with Customizable Increasing Number:

Dir *.jpg | ForEach-Object -begin { $count=1 } -process { rename-item $_ -NewName "image$count.jpg"; $count++ }

In above command one can use additional command which is known as foreach-object for setting a variable before looping files in directory and carrying out the action for each item. Result of this command will be image1.jpg, image2.jpg and so on.