or you use cmd
ren . *.txt
How to rename multiple files?
Chloe Jarman
26
Reputation points
Hi all,
I need to make multiple files in one folder (C:\Users\Desktop\BMS\Siemens Data) change from being the Type of file : File to a Type of file: Text Document (.txt). How do I do that using powershell?
4 answers
Sort by: Most helpful
-
-
-
Chris 656 Reputation points
2021-02-17T17:16:06.133+00:00 you need two stars, but editor remove my star in my example
ren star.star star.txt
-
js2010 191 Reputation points
2021-02-17T20:54:22.7+00:00 If I understand you correctly, this is very common. Take off the -whatif if it looks right. Added parentheses so the first part finishes before the second part.
(get-childitem -file) | rename-item -newname { $_.name + '.txt' } -whatif What if: Performing the operation "Rename File" on target "Item: C:\users\js\foo Destination: C:\users\js\foo.txt".