Announcement

Collapse
No announcement yet.

Add Batches to Right Click Context Menu in File Explorer

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Add Batches to Right Click Context Menu in File Explorer

    I normally use two batches on my pictures:
    _Resize pictures to max. height/width 1200 px and rename to $N_1200 save to the same folder
    _Resize pictures to max. height/width 500 px and rename to $N_500 save to the same folder

    I would like to apply these batches directly to the pictures in the file explorer of windows by using the context menu. Like this I could select the pictures in the file explorer open the context menu and choose IrfanView > Batches > My Batch 1.

    Like this I don't have to do the following:
    _Open IrfanView
    _Search the folder with pictures in it
    _Add the pictures to the Batch
    _Define the Batch (Resize, Rename)
    _Define output folder (Use current folder)

    Is this possible to add to IrfanView or is there a workaround to add such a command to the context menu on my own?
    Thanks and best regards




    #2
    It should be possible using IrfanView's command line options. There are programs allowing to add custom items to the context menu.
    My system: IrfanView 4.62 64bit, Windows 10 22H2, Intel Core i5-3570, 16GB RAM, NVidia GTX 1050Ti 4GB

    Comment


      #3
      A batch file can be written to do this. It can be accessed with drag and drop. I do this a lot. Drag and drop a single file from the directory to a shortcut to the batch file, let the batch file get the directory name from that file and process all the files in that directory. The batch file can also filter the list of files in the directory to only process jpgs, for example.

      I just have a directory with all my batch file shortcuts, have it open on my desktop, and drag and drop to them whenever I need to.

      Comment


        #4
        Thanks for the reply. Can you add the code of a simple batch file? Lets say resize to max. 1200, keep proportion, rename to $N_1200.

        Comment


          #5
          I know it's been a while, but how many files at a time do you expect to process? There is a command line length limit for drag and drop in windows and it limits the number of files that can be processed that way. An option is to create a folder and drag the files you want to process into it and then drag the folder to the batch file shortcut. The batch file could be written to automatically put the files back into the folder they came from if the new folder is in the folder they came from.

          Comment


            #6
            I could live with that. Define a folder and copy my pictures to that folder and execute the batch file. Sometimes it is only, sometimes more than 20 pictures. Pity, I really would love to have a right click option for that in the context menu. What would the batch command look like?

            Comment


              #7
              Basically go to the batch conversion and set up the resize command you normally use, for example the 1200 px one, exit Irfanview, and copy "C:\Users\<your ptofile>\AppData\Roaming\IrfanView\i_view64.ini" to a new directory and remember where that is. That copy will remember your settings for this batch file. If you change the batch conversion settings for some other task, you won't affect the batch file operation. Then, the batch file uses:

              cd %~f1
              "C:\Program Files\IrfanView\i_view64.exe" c:\*.jpg /ini="<that new directory with i_view64.ini>" /advancedbatch /convert=$N_1200.jpg
              move *.* ..


              The first line makes IV go to the directory you dropped onto the batch file, the second does the conversion. This converts all jpg files it finds (the ones you dropped in there). The third line moves all the files back in to the folder above the one you dropped the files into. This assumes you make a folder in the folder that your original images are in. You highlight and drop files into that folder and then drag and drop that folder onto the batch file (or a shortcut to that batch file). I usually keep the shortcuts in another folder that I have open while I'm working.

              I suggest testing this batch file on a copy of of some of your images that you place in a folder somewhere.

              Matt
              Last edited by IrfanUserGuyxyx; 15.11.2022, 12:30 AM.

              Comment

              Working...
              X