Batch rename files in Windows only after preserving the original folder and a separate backup. Practice on ten copied files, run the exact PowerShell rule with -WhatIf, and remove that switch only after every proposed name is correct.
Choose a manual or repeatable rename before touching files
Use File Explorer for a small set that needs simple, hand-checked numbering; use PowerShell when the same rule must be applied consistently. Writing the rule in one sentence first prevents a vague request such as “clean up these names” from changing more files than intended.
Suppose a camera folder contains 240 JPG files with spaces and inconsistent capitalization. The desired result is a stable trip- prefix, lowercase words, hyphens instead of spaces, and the original .jpg extension. Before doing anything, state that rule exactly: “Rename JPG files in the working copy only; add trip-, replace runs of spaces with one hyphen, lowercase the base name, and preserve the extension.”
For a ten-file practice set, open File Explorer with Windows key + E, select one copied file, press F2, type a name such as trip-001.jpg, and press Enter. Microsoft Support documents this File Explorer rename path. Manual numbering is slow, but it is easy to inspect when there are only ten representative files. Include names with spaces, mixed case, and a potential duplicate so the practice set exposes bad assumptions.
If the job needs search-and-replace logic across dozens of files, PowerShell is more repeatable. It is also less forgiving of a broad filter, so the backup and preview are part of the workflow, not optional precautions.
Preserve a backup and a separate working copy first
Create both a dated backup and a working copy before any rename command. Keep the source folder and backup untouched until the renamed files have been opened and accepted by the receiving system.
In File Explorer, create C:\RenameLab, then copy the source folder into it twice with distinct names. The equivalent PowerShell 7.5 commands are Copy-Item -LiteralPath 'C:\PhotoDrop' -Destination 'C:\RenameLab\PhotoDrop-backup-20260730' -Recurse and Copy-Item -LiteralPath 'C:\PhotoDrop' -Destination 'C:\RenameLab\PhotoDrop-work' -Recurse.
Run those copy commands before any Rename-Item command. If either destination already exists, stop and choose a new dated name rather than adding -Force or mixing new files into an old backup. Confirm that the source, backup, and working copy show the same file count, then perform all experiments inside PhotoDrop-work.
Avoid a drive root, Desktop root, or cloud-sync root as the test target. A dedicated folder makes the path visible in every preview line and reduces the chance that a broad command reaches unrelated files.
Preview the exact PowerShell rule with -WhatIf
The first rename command must include -WhatIf, which Microsoft defines as showing what the cmdlet would do without running it. Read every proposed source and destination before considering execution.
For the photo example, run Get-ChildItem -LiteralPath 'C:\RenameLab\PhotoDrop-work' -File -Filter '*.jpg' | Rename-Item -NewName { 'trip-' + (($_.BaseName -replace '\s+','-').ToLower()) + $_.Extension.ToLower() } -WhatIf.
This expression is deliberately narrow:
-LiteralPathpoints to the working copy, not the source or backup.-Fileexcludes folders.-Filter '*.jpg'limits the set to the intended extension.BaseNamechanges only the part before the extension.Extensionis appended explicitly so the file type suffix is preserved.-WhatIfprevents the rename while displaying the planned action.
Check the object count, path, prefix, punctuation, capitalization, and extension in the preview. Stop if two source names would become the same target. Microsoft documents that Rename-Item cannot replace an existing target item, but a failed collision still leaves a partially completed batch to investigate if it happens during execution.
Only after the backup exists and the complete preview is correct should you run the identical command without the final switch: Get-ChildItem -LiteralPath 'C:\RenameLab\PhotoDrop-work' -File -Filter '*.jpg' | Rename-Item -NewName { 'trip-' + (($_.BaseName -replace '\s+','-').ToLower()) + $_.Extension.ToLower() }. Do not broaden the filter between preview and execution.
The command is checked against Microsoft’s PowerShell 7.5 documentation. If the computer uses Windows PowerShell 5.1, an older PowerShell release, a non-file provider, or organization-specific restrictions, treat that as a different environment: check the local help, keep the dated backup, and require a clean -WhatIf result in the working copy before execution.
Prepare naming text without claiming a browser can rename files
Use ToolboxHub to prepare a text pattern, not to operate on a Windows folder. The Case Converter accepts pasted text and shows uppercase, lowercase, title, sentence, camel, Pascal, snake, and kebab forms that can help a team agree on a prefix.
For example, paste Summer Client Photos and compare summer-client-photos with summer_client_photos. Copy the approved prefix into the written rename rule only after checking the receiving system’s character and length requirements.
The page does not enumerate files, preview a PowerShell action, create a backup, rename anything, or write changes to disk. It also cannot detect duplicate target names. Windows and PowerShell perform the file operation; ToolboxHub only transforms the text that a person pastes into the browser.
If two reviewers prepare old-name and proposed-name lists, the Text Diff tool can compare pasted lists by line, word, or character. It does not inspect the folder or prove that file contents are intact.
Preserve extensions and remember that renaming is not conversion
Show full extensions before approving a batch, and never describe an extension change as file conversion. Microsoft Support states that changing an extension changes the name but does not convert the file or change its content.
On Windows 11, File Explorer exposes this under View > Show > File name extensions. The same Microsoft page covers Windows 10 with its older View controls, but free Windows 10 software updates, technical assistance, and security fixes ended on October 14, 2025. Older Windows interfaces are outside this article’s version scope.
Keeping Extension in the PowerShell expression prevents an accidental .jpg to .png rename. Even if a renamed file appears with a different icon, its bytes have not been converted. Use the source application or a real conversion workflow when a recipient requires another format, then open and inspect the generated file.
Verify the working copy and retain recovery evidence
Verification should cover both names and contents before the rule is reused on a larger copied set. Keep the backup until the full batch has passed those checks and the recipient or downstream system has accepted it.
After execution, compare the source, backup, and working-copy counts. Sort the working copy by name, look for doubled prefixes, missing numbers, unexpected extensions, and files that were not matched by the filter. Open the first, middle, and last renamed files in the application that normally handles them, plus any file with an unusual original name.
For a text-only name review, run Get-ChildItem -LiteralPath 'C:\RenameLab\PhotoDrop-backup-20260730' -File | Select-Object -ExpandProperty Name and the same read-only listing against PhotoDrop-work. Paste approved, non-sensitive lists into a diff tool if helpful, but treat that as a naming comparison rather than a content check.
If the result is wrong, stop using the working copy and return to the untouched source or dated backup. Do not delete the backup as part of the rename script, and do not improvise a second broad rule over a batch you no longer understand.
Frequently asked questions
Does -WhatIf create a backup?
No. -WhatIf previews the proposed action without running it; it does not copy or protect files. Create and retain a separate dated backup before the preview.
Can Rename-Item move a file to another folder?
No. Microsoft documents that Rename-Item changes the name and cannot use NewName to move an item to a different path. Plan a separate, equally cautious move workflow if location must change.
Can I change .jpg to .png in the rename rule?
You can change the text of the extension, but that does not convert the image. Use a real image conversion process and open the output to verify it.
Does ToolboxHub rename or preview files on my computer?
No. Case Converter and Text Diff only transform or compare pasted text. They do not read folders, make backups, run PowerShell, rename files, or inspect file contents.
When is File Explorer better than PowerShell?
File Explorer is a reasonable choice for a small practice set or a few manual numbers that can be checked one by one. PowerShell is useful for a precise repeatable rule, but only after a backup and a complete -WhatIf preview.