New
#1
Batch rename in DOS or Windows Powershell
Hi - sorry if this is not the right forum - please feel free to move this is need be.
So, I have this for batch renaming files in a folder:
Dir | rename-item -newname { $_.name -replace "oldname","newname" }
And it works like a charm. The thing I can not figure out how to do is add characters - w/o changing any. So let's say I have 3 files: 1.txt 2.txt and 3.txt - I want to change them to be x1.txt x2.txt and x3.txt
So I try replacing 'replace' with 'add' like this:
Dir | rename-item -newname { $_.name -add "x", }
But it doesn't work. Does anyone know if this is possible, and if so, what I am missing in my command line?
Thanks!