CodShot
Batch Public

Rename All JPG Files in a Folder

A Windows CMD loop that renames all JPG files in the current folder with a numbered prefix.

#cmd #windows #rename #file-system
Batch
@echo off
setlocal enabledelayedexpansion

set count=1

for %%F in (*.jpg) do (
    ren "%%F" "image-!count!.jpg"
    set /a count+=1
)

echo Done.
pause

Notes

Run this in a test folder first. Rename operations are difficult to undo.

Snippet actions

CodShot user
CodShot user
Updated: 2026-06-03 14:05
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