View Full Version : Automation / Command Lines etc.
Ant
October 16th, 2002, 12:50 PM
I am trying to get Monarch (version 3) to run a file through a model and export to an excel file automatically. There is help within Monarch but it doesn't give examples comprehensive enough for me to understand. I have a file "test.txt" and a model "pcl.mod" and I would like to have Monarch create a file called "test.xls" via the gift of command line switches.
The idea is that I want to place the command line into the Windows task scheduler to run the stuff for me.
What is the best way to do this ?
Can anyone help ?
Thanks in advance..
Ant.
Ant
October 17th, 2002, 06:46 AM
Ok I have managed to sort the automation bit out using a BAT file. The problem I now have is that we have 4 user licence on Monarch and when the script runs, Monarch opens and it asks for the password.
How do I get round this ?
Also, a possible side issue, when I do enter the password as prompted, it sais "User name already in use by another user etc.. " If I open Monarch normally I don't get this message.
I really want to avoid putting in the password altogether, can I add this into the BAT file ?
Ant.
[ October 17, 2002, 05:51 AM: Message edited by: Ant ]
Ant
October 17th, 2002, 07:15 AM
Now I am getting somewhere.. if I run the script with Monarch already open its fine. The only problem I have now is that the script is not producing a file.
can anyone see a problem with the following BAT file ?
cd Monarch
cd Reports
..ProgramMonarch.exe ..Data est.prn ..Modelspcl.mod ..Export est.xls
It runs and the task bar item sais its finished but I dont get the resulting file test.xls..
Any ideas why ?
Ant.
Steve Caiels
October 17th, 2002, 07:53 AM
Hi,
Monarch should not be running when Autoscript is used. You should not get the login name issue if you are one of the named Monarch Users.
If you are a named user, please ask your Monarch Administrator to check that your Registry key
(HKEY_CURRENT_USERSoftwareDatawatchMonarch ProSettings) matches one of the names in the Monarch Licnese Administrator program.
If your not a named user, you'll need to purchase a license or have one of the existing users removed and reassigned to you.
Regards
Steve
Ant
October 17th, 2002, 08:50 AM
Thanks for your reply Steve, very grateful. :0)
I think I have identified the problem thanks to your help :0). I cant seem to get the DOS prompt to change directory to c:program files so to try and get round this I copied it all to new directory with a simpler name. If I run monarch from the original directory its fine, but when I run it from the new directory, it prompts for a username.
So I need to alter my BAT to make it change directory to c:program files without telling me I can't.. or change the setup of Monarch to look to the new directory instead.
Any ideas on the cd thing ? is it because Program Files is more than 8 characters and has a space, is there a work around ? I'm not too familiar with Dos.
Ant.
Ant
October 17th, 2002, 09:09 AM
I got the BAT file to work from c: by using "cd PROGRA~1". That worked so I am now running it from the correct directory.
Monarch now opens without a username prompt but when I close Monarch and try to run a script from the AutoScript program I get a "Network Licence Meter Program" Error.. "User name already in use etc.."
I am lost to why this is happening.
Ant.
Ant
October 17th, 2002, 09:29 AM
Its working !
I neglected to check the path of the executables which turned out to be on the network. I have adjusted the BAT file to suit and now it works :0)
Great stuff, Thanks again.
Ant.
Steve Caiels
October 18th, 2002, 09:33 AM
Glad it's working.
You can also specify long path names by using quotes. for example
cd "program filesmonarch"
and lines like
programmonarch "reports his is my file.prn" "models his is my model file.mod" etc etc
Will be OK
Cheers
Steve
[ October 18, 2002, 08:33 AM: Message edited by: Steve Caiels ]
vBulletin® v3.7.0, Copyright ©2000-2008, Jelsoft Enterprises Ltd.