How to change extension of all files with one command in Windows?

+1 vote
asked 6 days ago by Hitesh Garg (167 points)  

I have some files which are downlaoded with .html extension but these are actually .srt files for some videos.

Is there a way to change the extension of all the files with a command in windows.?

1 Answer

+1 vote
answered 6 days ago by Rahul Singh (253 points)  
selected 6 days ago by Hitesh Garg
Best answer

It can be done with some simple commands -

xcopy command

Use this command to keep the original and create a new file with the srt extension. Wildcard helps in renaming all at once.

xcopy *.html *.srt

rename command

This command will rename the existing files and will change only the extension.

rename *.html *.srt

For a single file you can use the complete name -

rename hope.html

move command

Just like using the rename command, you can also use the move command to rename a file as shown below.

move hope.txt hope.html

Hope it helps. :)

commented 6 days ago by Hitesh Garg (167 points)  
I tried rename command and it works perfectly, Thanks :)

36 questions

24 answers


17 users

Welcome to Codingeek Q&A, where you can ask questions and receive answers from other members of the community.