CodShot
PowerShell Public

Rename Images with Counter

Rename JPG images in a folder with a clean numbered filename.

#powershell #windows #rename #images
PowerShell
$counter = 1

Get-ChildItem -Filter *.jpg | ForEach-Object {
    $newName = "image-{0:D3}.jpg" -f $counter
    Rename-Item -Path $_.FullName -NewName $newName
    $counter++
}

Notes

Test file rename scripts in a copied folder first.

Snippet actions

CodShot user
CodShot user
Updated: 2026-06-03 15:31
Public snippets
0
Forks
CodShot AI Help
Ask about CodShot features, plans, workspace, AI limits, referrals, and public help topics.
Hi! I can help you understand how CodShot works. What would you like to know?
For account-specific or sensitive issues, please open a support ticket. Open support