AKZN Notes

Archives for My Lazy and Forgetful Mind

Batch Rename Images Using Windows PowerShell

.JPG to .jpg

To rename all .JPG files to .jpg in a directory using PowerShell, follow these steps:

  1. Open PowerShell.
  2. Navigate to the folder containing the .JPG files using the cd command.
  3. Run the following command:

    Get-ChildItem -Filter *.JPG | Rename-Item -NewName { $_.Name.ToLower() }

This command will find all files with the .JPG extension and rename them to use the .jpg extension.

.png to .jpg

Get-ChildItem -Filter *.png | Rename-Item -NewName { $_.BaseName + ".jpg" }

Leave a Reply

Your email address will not be published.