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

+1 vote
asked Aug 11, 2017 by Hitesh Garg (352 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 Aug 11, 2017 by Rahul Singh (543 points)  
selected Aug 11, 2017 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 Aug 11, 2017 by Hitesh Garg (352 points)  
I tried rename command and it works perfectly, Thanks :)

124 questions

41 answers


928 users

Most popular tags

java python python3 oracle database java-8 sql-server python2 oracle11g git oracle-12g command-line maven sql-server-2012 sql input array list fenitoina dilantin javaçš„ angular javascripts git-branch intellij-idea hashmap collection file-io io temovate clobetasol ampicillin principen daclatasvir daklinza vasotec enalapril nexium esomeprazole tadalafil tadlis sildenafil citrate pefomax xeloda capecitabina clobetasol temovate stemetil prochlorperazine methotrexate methotrexate sildenafilo y dapoxetina super kamagra norvasc amlodipine citalopram celexa amitriptylin saroten vitamin b12 methylcobalamin valaciclovir valtrex zudena udenafil sildenafil citrate vigour depakote divalproex retin-a tretinoine sildenafil citrate ip-max nizoral ketoconazol ciaton tadalafil norethisteronacetat aygestin indomethacin indocin tiova tiotropium bromid finasterida proscar lithium carbonate eskalith finasterida propecia levitra vardenafil vantin cefpodoxima loxitane loxapine rulide roxithromycine avodart dutasterid tecnomax sildenafil citrate methylcobalamin vitamin b12 permethrin acticin etinilestradiol norgestrel ovral pk-merz amantadin cycrin medroxyprogesterone serophene clomiphene spironolactone aldactone mesalazin pentasa zebeta bisoprolol cytodrox hydroxyurea ampicillin ampicillin pletal cilostazol paracetamol panadol pepcid famotidina meclizine hydrochloride antivert donaton tadalafil sdf dsfs sdgfgsdg mac null-pointer-exception constructor oracle-12c terminal hibernate-5 hibernate git-merge es6 programming git-amend git-commit java-stream git-remote multithreading access-modifiers nested-classes
Welcome to Codingeek Q&A, where you can ask questions and receive answers from other members of the community.