Results 1 to 10 of 19

Thread: Batch files and Scripts

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Professional User Mij's Avatar
    Join Date
    Mar 2007
    Camberley, Surrey, UK
    IrfanView 4.51
    32-bit Win 10
    CPU Cores

    Default Batch files and Scripts

    Over the years I have seen a number of Batch files (.bat) and Scripts (.vbs , .js , etc) posted for use with Irfanview. Most have been posted as replies to Support or Feature requests, so are difficult to find again even if they are still somewhere on the current forum.

    That is why I am starting this thread in the hope that those who have previously posted Batch files and Scripts that they think may be useful can record where they can be found and also somewhere to post any new ones.

    I will start the ball rolling by posting a Script. Its purpose is to replace entries in the Irfanview ini file. The idea is that you prepare small change files that contain lines that match those in the Irfanview file that you want to replace. The file "canvas1.ini" in the zip file is an example of one to change the width of the canvas margins. Those who use a command line with the Irfanview /batch option often complain because options such as these are not included in the dialog. This Script allows the values to be quickly changed before the /batch option is run.

    To use the "ini_replace.vbs" script file on its own you will first need to modify line 18 of the script using Notepad to record where the i_view32.ini file is located on your system (hopefully in the Appdata folder or another folder that has full read and write permissions). After doing that you can just drag and drop a change file onto the script file icon and the changes will be made. The script has lines (starting "wscript.echo ...") that will report on each change made. If you do not want that just put a ' at the start of those lines.

    You can also run the script from a batch file using the Cscript program included in Windows. The file "ini_replace.bat" is included as an example. With this you can specify where you have put the script file and where the ini file is. Then just drop the change file onto the ".bat" instead of the ".vbs". The reports then appear in the Command prompt window which is more convenient.

    Note that the replacement lines in the change files must be in exactly the same form as those in the original ini, including upper and lower case characters. Probably a good idea to make a backup copy of your ini file before you start playing, just in case!
    Attached Files Attached Files

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