Thursday, August 6, 2015

Rename Multiple files with unknown/different names using powershell to same name

I have a group of pictures (.jpg) all in the same folder that are all named something different. I am trying to rename all of them to the same name, numbered consecutively like it would in file explorer. EX. Test.jpg, Test(1).jpg Test(2) and so on.


This is what I have been trying but it tells me 'cannot create a file when that file already exists' and only changes the name of one file.


Get-ChildItem | Rename-Item -newname { 'Test.jpg' }

I am hoping some could show me a way to get it to number them like above.
Thanks For All Help In Advance.

No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...