I am attempting to invoke HMS to run headlessly by prompting a batch file containing the following:
cd C:\Program Files\HEC\HEC-HMS\4.4 hec-hms -s C:\Users\abudhabikid\Desktop\TESTING\Project\BasinName_batch.script
The script itself contains the following:
OpenProject("Project", "C:\Users\abudhabikid\Desktop\TESTING\Project") Compute("Run_Title") Save Exit(1)
These files are created in accordance to the section in the HMS manual regarding command line operation.
However, when my code invokes the script (or if I run the script myself through the command line, I receive the following error:
Note that this does not occur every single time that the script is run and I cannot tell that there is any pattern.
My requirements are that HMS run multiple times to satisfy a loop and I can't have users sitting at their desks clicking "OK".
I can see three directions here:
- There's some additional code I should put in the .script that tells HMS to OpenProject and Compute and so-on
- There's some code I can add to my VBA program to listen for this error message window and close it automatically
- There's some edits to the .config file I need to make (possibly regarding the java.exe and javaw.exe paths); I have played around with this to no avail and I'd really rather not have to edit every user's .config file before they could use my program
- (Bonus) Maybe I should limit users to a certain version of HMS?
I really hope somebody knows what do to here.