V
V
VN2022-02-15 11:29:03
PowerShell
VN, 2022-02-15 11:29:03

How to bulk rename files in PowerShell?

How to bulk rename files in PowerShell.

There is:

323289402.jpg
273728399.jpg
290322-893.jpg


Need to get:

File_1.jpg
File_2.jpg
File_3.jpg

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Eugene, 2022-02-15
@kavabangaungava

Get-ChildItem -Path C:\temp -File | foreach {$i=1}{$_ | Rename-Item -NewName "File_$i.jpg" ;$i++}

V
Vladimir, 2022-02-15
@FluffyBeaver

To "take" files (using get-item, for example) and "feed" them to the Rename-Item cmdlet.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question