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!
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!
Comment