ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Bulk Replace Images

    Scheduled Pinned Locked Moved Solved IT Discussion
    11 Posts 4 Posters 899 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      Alex Sage
      last edited by Alex Sage

      I have a thousands of folders, each with one image inside (along with other data).

      I need to replace every image, with a new one (same image). The same image will be copy

      What's the best way to script this?

      The images files all have the same name, and extension.

      1 Reply Last reply Reply Quote 1
      • DustinB3403D
        DustinB3403
        last edited by

        Windows or Linux?

        A 1 Reply Last reply Reply Quote 0
        • A
          Alex Sage @DustinB3403
          last edited by

          @dustinb3403 I can handle both, but hoping for Windows.

          1 Reply Last reply Reply Quote 0
          • DustinB3403D
            DustinB3403
            last edited by

            Hrm. . .

            Do you want the original image overwritten or can the script go back and just drop the file into this directory?

            Are the images the same in each directory or is it a unique image per directory?

            A 1 Reply Last reply Reply Quote 0
            • DustinB3403D
              DustinB3403
              last edited by

              Powershell seems to be the key here (a few different links from google)

              One
              Two

              1 Reply Last reply Reply Quote 1
              • black3dynamiteB
                black3dynamite
                last edited by

                https://stackoverflow.com/questions/3312310/replacing-a-file-into-multiple-folders-subdirectories

                FOR /R C:\MyPath\ %%I IN (5.jpg) DO COPY /Y C:\NewImage\5.jpg %%~fI
                
                

                OR

                Replace C:\SomeFile.Txt C:\SomeRootFolder_ContainsMultipleSubFolders /s
                
                A 1 Reply Last reply Reply Quote 0
                • A
                  Alex Sage @DustinB3403
                  last edited by

                  @dustinb3403 the image need to be overwritten. The image is the same (name+ext) in every directory.

                  DustinB3403D 1 Reply Last reply Reply Quote 0
                  • DustinB3403D
                    DustinB3403 @Alex Sage
                    last edited by

                    @aaronstuder take a look at link One than.

                    1 Reply Last reply Reply Quote 1
                    • A
                      Alex Sage @black3dynamite
                      last edited by

                      Replace C:\SomeFile.Txt C:\SomeRootFolder_ContainsMultipleSubFolders /s
                      

                      This worked perfectly!

                      1 Reply Last reply Reply Quote 1
                      • momurdaM
                        momurda
                        last edited by momurda

                        I didnt even know replace.exe exists.

                        A 1 Reply Last reply Reply Quote 0
                        • A
                          Alex Sage @momurda
                          last edited by

                          @momurda was news to me too. Good news! 🙂

                          1 Reply Last reply Reply Quote 1
                          • 1 / 1
                          • First post
                            Last post