Click here to Skip to main content
15,868,016 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Suppose I have a large number of files in a directory with the .txt extension.

How can I change the extension of all these to .c?

I KNOW THAT ' ren *.txt *.c ' works from command promt but it did't work from power shell and for terminal.

please help!
Posted
Comments
[no name] 25-Aug-12 8:47am    
That's because in PS you use Rename-Item

1 solution

From Batch File Rename with Windows PowerShell[^]:
Dir *.txt | rename-item -newname {  $_.name  -replace ".txt",".c"  }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900