PowerShell – renaming files

The MS Windows bash-shell-like wannabe…

Open powershell, cd to your folder and then type this:

> $var=0
> Get-ChildItem *.ext_from | foreach { Rename-Item $_ $var".ext_to"; $var++; }

and it will produce something like
0.ext_to
1.ext_to
2.ext_to
3.ext_to
….

At least you don’t have to learn PowerShell to do group renaming on Windows…

Annunci