How can I use the Windows command line to change the extensions of thousands of files to *****.jpg?
How can I use the Windows command line to change the extensions of thousands
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use
ren(as in rename):And of course, switch XXX and YYY for the appropriate extensions. It will change from XXX to YYY. If you want to change all extensions, just use the wildcard again:
One way to make this work recursively is with the
FORcommand. It can be used with the/Roption to recursively apply a command to matching files. For example:for /R %x in (*.txt) do ren "%x" *.renamedwill change all
.txtextensions to.renamedrecursively, starting in the current directory.%xis the variable that holds the matched file names.And, since you have thousands of files, make sure to wait until the cursor starts blinking again indicating that it’s done working.
Note: this works only on cmd. Won’t work on Powershell or Bash