-3

I need help creating a batch file to find multiple files named the same thing in 100's of files and replace the with a different file...

Alternatively, is there a program that will do this if I select the 2 different files that will search and replace them...

  1. Find file from computer Pairing = High School DxD - Kuroka.png
  2. Replace file with Pairing = High School DxD - Kuroka (F).jpg
John Kens
  • 1,615
  • 2
  • 10
  • 28
  • 2
    The term "helping" implies that you do something on your own rather than just requesting code for free. Please share your efforts by providing a [mcve] of your coding attempts! Also read the [tour] and learn [ask] here! – aschipfl Jul 17 '18 at 11:02
  • 1
    Changing the file extension does not change the type of file; are you sure you aren't wishing to convert a file? – Compo Jul 17 '18 at 12:29

1 Answers1

0

Since you never provided the basic information such as What directory you wish to start a search from or You wish to convert or just rename, I will assume you wish to search your photo's folder (Including sub-directories) and simply rename file.jpg to file.png.

To search photo's and all its directories we can use the FOR /R to search for all .jpg files and DO to address the action. The script bellow will do the following.

  • Search and replace all .jpg extensions to .png in the photo folder directory

Batch Script:

@ECHO ON
@CD C:\Users\%username%\Pictures

For /r %%A In (*.jpg *.jpeg) Do ren "%%A" "*.png"
goto :eof
John Kens
  • 1,615
  • 2
  • 10
  • 28