Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question

Revision history [back]

The simplest way to run several batch runs is to just sequentially hard-code the DOE2 batch command for every run you want. For example, if you just had 3 files located in a folder named c:\inp_files, you could use a .bat file like the following.

c:\\doe21e\doe21e.bat c:\\inp_files\\building1 TN_Memphis_International
c:\\doe21e\doe21e.bat c:\\inp_files\\building2 TN_Memphis_International
c:\\doe21e\doe21e.bat c:\\inp_files\\building3 TN_Memphis_International

The output files will be named the same as the input files but with a .sim extension by default. To do specifically what you've asked, which is to run all inp files in a particular folder, you could use the following.

:: Script to runs DOE2.1E simulations for all .inp files
:: located in the inp_dir folder
:: Do not include spaces in inp file names
:: weather file must be in c:\\doe21e\weather\packed folder

set inp_dir=c:\\inp_files
set doe_cmd=c:\\doe21e\\doe21e.bat exent
set weather=TN_Memphis_International

:: Run simulations for each inp file in folder
for /r  %inp_dir%  %%f in ( *.inp) do (
  call %doe_cmd% %%~pf%%~nf %weather%
)

Just change inp_dir to the folder that you want and weather to the weather file that you want. This may look a little ugly because it uses some Windows command jargon, but you can accomplish a similar result that will look cleaner with other languages like Python or Java if you are familiar with them.