Safely Rename a Batch of Photos with a GitHub Copilot Script
Use Copilot in VS Code to generate a small Python script, test it on copies, then rename your real photos in one click.
This guide was written by AI. It passed automated fact and quality checks, and our editor spot-checks published guides every day.
See AI World HQ first on GoogleAdd us as a preferred source and our stories show up higher in Google’s Top Stories.Add on GoogleBy the end of this short guide, you'll have asked Copilot to write a small Python script, tested it on copies of your photos, and renamed an entire folder without typing a line of code yourself. If you have a folder of vacation shots named IMG_4829.jpg, IMG_4830.jpg, and so on, this is for you.
💡 Tip: tap a step’s number when you finish it — a green tick appears and your browser remembers how far you got.
- A computer running Windows, macOS, or Linux.
- VS Code installed — the free code editor from Microsoft (download from
code.visualstudio.com). - The GitHub Copilot extension installed in VS Code, with a Copilot account signed in. Copilot offers a free tier and paid plans; check the official GitHub page for current availability and which features each tier includes.
- Python installed on your computer (download from
python.org). Python is the language your script will be written in — think of it as plain English instructions for your computer. - A folder of photos you'd like to rename, plus enough free disk space to make a copy. The whole task takes about 15 minutes.
- Skipping the test folder. It's tempting to point the script straight at your real photos, but one wrong rule can scramble hundreds of filenames at once. Always run the script on copies first, then on the real folder only after you're sure the names are right.
- Running the script twice without changing the names. The second run will keep building on your filename pattern (
vacation-2024-001.jpgcould becomevacation-2024-001-001.jpg). Either move the renamed files out, or include the "skip if already named" rule in your prompt. - Trusting Copilot's first answer without reading. Copilot is helpful but not perfect. If the script does something you didn't ask for — like deleting files or changing the file extension — rewrite your prompt to be more specific and try again on the test folder.
Open your test folder in VS Code, open the Copilot chat, and paste this exact message.
Run it on a tiny folder of 3 to 5 test files. Seeing those photos rename themselves is the moment this stops feeling like magic and starts feeling like a tool you control.
❓ Quick questions
How long does this take?
About 6 minutes — the guide has 6 steps, and you can tick each one off as you go.
Which tool do I need?
This guide uses GitHub Copilot — but the approach works very similarly in other AI assistants.
Do I need to prepare anything?
- A computer running Windows, macOS, or Linux.
- VS Code installed — the free code editor from Microsoft (download from
code.visualstudio.com). - The GitHub Copilot extension installed in VS Code, with a Copilot account signed in. Copilot offers a free tier and paid plans; check the official GitHub page for current availability and which features each tier includes.
- Python installed on your computer (download from
python.org). Python is the language your script will be written in — think of it as plain English instructions for your computer. - A folder of photos you'd like to rename, plus enough free disk space to make a copy. The whole task takes about 15 minutes.
What mistakes should I avoid?
- Skipping the test folder. It's tempting to point the script straight at your real photos, but one wrong rule can scramble hundreds of filenames at once. Always run the script on copies first, then on the real folder only after you're sure the names are right.
- Running the script twice without changing the names. The second run will keep building on your filename pattern (
vacation-2024-001.jpgcould becomevacation-2024-001-001.jpg). Either move the renamed files out, or include the "skip if already named" rule in your prompt. - Trusting Copilot's first answer without reading. Copilot is helpful but not perfect. If the script does something you didn't ask for — like deleting files or changing the file extension — rewrite your prompt to be more specific and try again on the test folder.
Keep reading
✦ Generated by AI in AI World HQ's automated newsroom, written in plain language. Checked by automated fact and quality gates, and our editor spot-checks published guides every day. Spot a mistake? Use the buttons above.
📘 Prefer it in one file? Photos and Images: The AI Pack (20 guides, free printable PDF)
← Back to all stories
