Results 1 to 5 of 5

Thread: Command Line Guidance - Please !!!

  1. #1

    Default Command Line Guidance - Please !!!

    Hey guys, tks for accepting me on the forum.
    I am a beginner on Irfanview and command lines so I really appreciate your guidance.
    I need to create a small process for editing pics in a .bat file.
    The file is working fine when I write the name of the file. What I need is to drag and drop a folder with multiples images and then do some editing, exactly how it is on the command below. Can you help me with that?

    "C:\Program Files (x86)\IrfanView\i_view32.exe" "C:\Users\Fernando Costa\Desktop\in\PathA\pic1.jpg" /gamma=1.60 /advancedbatch="C:\Users\Fernando Costa\Desktop\resize and canvas.ini" /convert="C:\Users\Fernando Costa\Desktop\in\PathB\pic01canvas.jpg"


    move "C:\Users\Fernando Costa\Desktop\in\PathA\*.*" "C:\Users\Fernando Costa\Desktop\in\PathC"

    move "C:\Users\Fernando Costa\Desktop\in\PathB\*.*" "C:\Users\Fernando Costa\Desktop\in\PathA"

    move PathA "C:\Users\Fernando Costa\Desktop\in\PatchD"

  2. #2
    Professional User Mij's Avatar
    Join Date
    Mar 2007
    Location
    Camberley, Surrey, UK
    Posts
    2,763
    Version
    IrfanView 4.51
    OS
    32-bit Win 10
    CPU Cores
    3

    Default

    First I have to say that you are really in the wrong part of the forum. We have a "Command Line and Scripts" section further down the Forum that can be used so that those members who have no idea what we are talking about need not be bothered by it.

    "Wishes and questions" is the part of that section best suited to your request. In there you will find my "Where to find help" thread which was intended to be a final contribution on batch files after I had decided to use Visual Basic scripts exclusively four years ago. Even that decision may now seem rather dated as Microsoft pushes Powershell further to the front. Take a look at this link.

    If no one else comes forward I will help you with the Irfanview command syntax but I am reluctant to engage in depth with batch scripts any more. There are others who read this forum who are still committed to them however.

    In my "Where to find help" take a look at "Using batch parameters". It may have some of the answers you need or it might frighten you.
    Last edited by Mij; 06.10.2016 at 07:12 PM.

  3. #3
    Moderator Enterprise User Bhikkhu Pesala's Avatar
    Join Date
    May 2007
    Location
    East London
    Posts
    6,135
    OS
    64-bit Win 10
    CPU Cores
    1

    Default

    Thread moved. Duplicate thread deleted.

  4. #4
    Professional User Mij's Avatar
    Join Date
    Mar 2007
    Location
    Camberley, Surrey, UK
    Posts
    2,763
    Version
    IrfanView 4.51
    OS
    32-bit Win 10
    CPU Cores
    3

    Default

    OK as promised I will help you to get the Irfanview command right. This is what you had in your batch file


    "C:\Program Files (x86)\IrfanView\i_view32.exe" "C:\Users\Fernando Costa\Desktop\in\PathA\pic1.jpg" /gamma=1.60 /advancedbatch="C:\Users\Fernando Costa\Desktop\resize and canvas.ini" /convert="C:\Users\Fernando Costa\Desktop\in\PathB\pic01canvas.jpg"
    This is what you would enter to process all the jpeg files in the PathA folder and save the result in the PathB folder with the original file names
    "C:\Program Files (x86)\IrfanView\i_view32.exe" "C:\Users\Fernando Costa\Desktop\in\PathA\*.jpg" /gamma=1.60 /advancedbatch="C:\Users\Fernando Costa\Desktop\resize and canvas.ini" /convert="C:\Users\Fernando Costa\Desktop\in\PathB\*.jpg"
    This will try to process all the files in PathA of any type and save them in PathB as a jpeg file with a name as in your batch file
    "C:\Program Files (x86)\IrfanView\i_view32.exe" "C:\Users\Fernando Costa\Desktop\in\PathA\*.*" /gamma=1.60 /advancedbatch="C:\Users\Fernando Costa\Desktop\resize and canvas.ini" /convert="C:\Users\Fernando Costa\Desktop\in\PathB\pic##canvas.jpg"
    Note though that if there are any files in PathA that Irfanview cannot open, an error message will appear and the process will stop until you OK it.

    Next you asked to be able to drag and drop a folder onto the batch file icon to process the files that are in it. This is where we get to meet the batch file "quote marks" nightmare. In theory all you have to do is type %1 in your script wherever you want the folder name to appear but you sometimes have to use %~1 instead so that it can accept folders with spaces in the names. This is what usually works
    "C:\Program Files (x86)\IrfanView\i_view32.exe" "%~1\*.jpg" /gamma=1.60 /advancedbatch="C:\Users\Fernando Costa\Desktop\resize and canvas.ini" /convert="C:\Users\Fernando Costa\Desktop\in\PathB\pic##canvas.jpg"
    I hope that is enough to get started at least.

  5. #5
    IV Newbie
    Join Date
    Jan 2018
    Location
    Alabama
    Posts
    8
    Version
    IrfanView 4.41
    OS
    64-bit Win 10
    CPU Cores
    2

    Default

    A dropped file is a %i option in your command line, if file is in a long name folder area use space "%i" i stands for input. Also serves to name the location of the file path upon run of the batch file. Your using words like Path A, Path B, Path C and in doing that your environment would have to define those words in each separate Path.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •