You can use PowerShell to rename multiple files with Rename-Item, the command for changing an item’s name. [1] First identify the target folder, then preview the intended changes before applying them so you can catch an incorrect selection or naming pattern early.
The right approach depends on the change: switching a file extension is different from adding a number or replacing part of a filename. [2] For example, you might change a group of extensions, add a sequence to photo names, or replace a repeated word in document filenames. Use Rename-Item for the rename itself; it changes the item’s name, not its contents. [1]
Choose the folder and naming pattern first
Choose the target folder and write down the naming pattern before you rename multiple files with PowerShell. That way, you can decide exactly which files belong in the batch and what each new name should look like.
Open PowerShell in the right folder
You can open PowerShell in the folder that contains the files, or identify that folder explicitly when you run your commands. [3] For example, if you are organizing photos, start with the folder that holds those photos rather than a parent folder containing unrelated documents.
Keep the folder choice and the file-selection rule clear in your notes. If you want to work only with .jpg files, record that extension; if you want a narrower group, write down the filename pattern that distinguishes it, such as names beginning with Trip_. The exact pattern you use determines which items are included, so avoid describing the target as simply “the files in the folder.”
Write down before-and-after examples
Before writing a rename expression, list a few current names beside the names you want. For example, you might note Trip_beach.jpg → Vacation_beach.jpg and Trip_hike.jpg → Vacation_hike.jpg; these examples make the intended change easy to check.
Include one name that should stay untouched, too. If Notes.txt is not part of the batch, writing it beside your examples helps you clarify that the selection is limited to the intended image files—not every item in the folder.
Check the exact syntax
PowerShell’s Rename-Item documentation gives the supported syntax for renaming an item, including its path and new name. [1] Verify the exact syntax you plan to use against that documentation; don’t assume a wildcard destination form will substitute part of every filename as intended.
For example, decide whether your plan changes only the beginning of each name or also changes its extension. The written examples should show that decision plainly before you build the command.
Preview the files you plan to rename
In PowerShell, use
Get-ChildItemto list the files in the current directory. [3] This gives you a visible inventory to inspect before you proceed.Read through the output and make sure every listed file is one you intend to include. For example, if you plan to work on a group of photos, check that the list does not also include unrelated documents. [3]
Confirm the selection is not empty and is not broader than you intended. If you expect a few specific files but the listing shows many unrelated items—or no files at all—stop and adjust what you are listing before continuing.
Treat this listing as a verification step, not as proof that a later rename will affect only the intended files. Check the exact
Get-ChildItemoptions you plan to use against PowerShell documentation before adding options or changing how the command selects files.
For example, a listing that includes both report-old.txt and notes.txt is too broad if your intended group is only the report files. Narrow the selection, then inspect the resulting list again before moving on. The preview is useful only when the displayed files match the set you mean to rename.
Change several file extensions
For an
.xml-to-.tmpbatch, keep each file’s base filename and change only its extension—for example,invoice.xmlbecomesinvoice.tmp.Rename-Itemchanges an item’s name, not its contents, and its documentation lists-WhatIfas an available parameter. [1]Select the intended
.xmlfiles in the folder you have already identified. For example,invoice.xmlandreceipt.xmlshould becomeinvoice.tmpandreceipt.tmp; do not try to use*.tmpas a wildcard destination pattern. Rename-Item takes a new name for the item you specify, so give it a full name such as invoice.tmp rather than a wildcard like *.tmp.[1]Preview every proposed result before applying the rename. Add the -WhatIf parameter to Rename-Item to see what the rename would do without making any change.
Compare each previewed name with its original:
invoice.xmlshould map toinvoice.tmp, notreport.tmporinvoice.xml.tmp. Confirm that the selected set contains only the files you intend to change and that every proposed name preserves its own base filename. [1]Apply the rename only after the selection and every resulting name are correct. Because renaming changes file paths and extensions, an incorrect selection or destination name can leave you with files at unexpected paths or with unexpected extensions; the new extension also does not change the file contents. [1]
Add a prefix or replace part of each name
To add a prefix or replace part of a filename, identify the exact text that should change and the text that should stay. For example, if every selected file begins with draft_, decide whether to remove that prefix, replace it with final_, or add a new label before the existing name.
For a replacement, compare the same part of each name: draft_notes.txt becomes final_notes.txt, and draft_report.txt becomes final_report.txt. For a prefix addition, notes.txt becomes 2025_notes.txt, while report.txt becomes 2025_report.txt.
To replace the leading draft_ text in every file name in the current folder, run the command below; it leaves the rest of each name intact, and you can change the quoted text to match the part you want to replace. Get-ChildItem -File | Rename-Item -NewName { $_.Name -replace ‘^draft_’, ‘final_’ } It targets the leading draft_ text, leaving the rest of each filename intact; adapt the quoted text to match the exact substring you intend to change. The documented command renames an item, but it does not change that item’s contents. [1]
Before applying a batch, check that every proposed destination name is distinct and does not already exist. For example, if two different selected filenames would both turn into final_notes.txt, the names collide; Rename-Item cannot replace an existing item with the new name. [1] Resolve the overlap by adjusting the selection or choosing a more specific replacement pattern.
Use the same reasoning for additions: choose a prefix that makes each resulting filename unique, rather than assuming the original names will remain distinct after the change. If you are replacing text that appears in multiple places, make sure your intended change is limited to the occurrence you want; a broad replacement could alter more of the name than you planned. Once the intended text and distinct destination names are clear, the expression’s replacement text should reflect that decision.
Verify the renamed files and handle mistakes
List the target folder again after the rename and compare each resulting filename with the pattern you intended. Rename-Item changes an item’s name, not its contents, so a new extension alone does not make the file’s contents match that format. [1]
For example, if your intended pattern is report_01.txt, report_02.txt, and report_03.txt, check that the renamed files match those names exactly. Look for an unchanged old name, an unexpected prefix or suffix, or a missing file; these are signs that the result differs from the plan. If you used a different pattern, compare the list against your own before-and-after examples.
If a rename fails, make the selection more specific before trying again. For example, narrow it to files with the intended prefix or extension, then test the naming logic on a few nonessential copies. This helps you see whether the pattern produces the filenames you expect without changing the intended files.
Keep extensions tied to actual file formats. Changing notes.xml to notes.tmp changes its name, but it does not convert the XML contents into a TMP format; the file’s contents remain unchanged by the rename. [1] If an application cannot open a renamed file, check whether the extension accurately describes the file’s contents before treating the rename as a successful format change.
Make the next batch predictable
For a predictable batch rename, follow the same sequence each time: select the files, preview the intended changes, rename them, and verify the new names. A PowerShell rename changes an item’s name, not its contents, so check that the resulting filenames match your plan. [1]
If the naming pattern is unfamiliar, start with a small test set—for example, a few files with different names—before applying it to the full selection. Add the -WhatIf parameter to Rename-Item to see what the rename would do without making any change.
