function build_piper_bat_file( export_folder, file_pointers)
% Generates a BAT file for the batch execution of a specific model.
% In a second step, the BAT file can be called.
% The BAT file calls a Python script, which is then in turn executed
% by PIPER. All the information about the model operations is contained
% inside the Python script.
%
% :param export_folder: string - Name of folder to place BAT file.
%                                It is assumed the python file will also
%                                exist in this folder.
% :param file_pointers: struct - Struct with file names. Needs to contain
%                                at least the fields "piper_bat_name",
%                               "piper_script_name" and "piper_dir".
%
% :return None: 				If successful, a file is created.
%
% created by : ABR august@lightness.eu
% date : 2024-04-24

fileID = fopen([export_folder file_pointers.piper_bat_name],'w');
fprintf(fileID,'@echo off\n')
fprintf(fileID,'set PIPERDIR=%s\n', file_pointers.piper_dir);
fprintf(fileID,'set PATH=%%PIPERDIR%%\\bin\\;%%PIPERDIR%%\\Python27\\;%%PIPERDIR%%\\Octave\\bin\\;%%PATH%%\n');
fprintf(fileID,'set PYTHONPATH=%%PIPERDIR%%\\Python27\\\n');
fprintf(fileID,'set PYTHONHOME=%%PIPERDIR%%\\Python27\\\n');
fprintf(fileID,'set PYTHONUSERBASE=%%PIPERDIR%%\\Python27\\\n');
fprintf(fileID,'set OCTAVEPIPERPATH=%%PIPERDIR%%\\Octave\n');
fprintf(fileID,'"%%OCTAVEPIPERPATH%%\\octavePathSetter.exe" "%%OCTAVEPIPERPATH%%\\share\\octave\\template_octave_packages" "%%OCTAVEPIPERPATH%%\\share\\octave\\octave_packages" %%OCTAVEPIPERPATH%%\n');
fprintf(fileID,'@echo on\n')
fprintf(fileID,'"%%PIPERDIR%%\\bin\\piper.exe" --batch "%s" \n', [export_folder file_pointers.piper_script_name]);
fclose(fileID);
