Page 1 of 1

Calling MMEX from script.

Posted: Wed Nov 11, 2015 6:09 pm
by Sherlok1948
Is there a Command Line Interface so that I can start MMEX from  vbscipt with a specified database?

Re: Calling MMEX from script - SOLVED

Posted: Thu Nov 12, 2015 11:45 am
by Sherlok1948
After some hours playing with vbscript, I found this to work:

Set sh=CreateObject("Wscript.Shell")
sh.Run  """C:\Program Files\MoneyManagerEX\bin\mmex.exe"" ""N:\financial\Fred\Financial\Money Manager DB\Fred Money Manager DB.mmb"""

or if the DB is in the same folder as the script and the DB name contains no blank spaces:

Set sh=CreateObject("Wscript.Shell")
sh.Run  """C:\Program Files\MoneyManagerEX\bin\mmex.exe"" DB.mmb"

I hope that this is useful to those looking for answers to the same problem.

Re: Calling MMEX from script-SOLVED-well, not quite!

Posted: Thu Nov 12, 2015 3:43 pm
by Sherlok1948
I have the following vbscript (using test folders):

Dim filesys,file1, date1, date2
Set filesys = CreateObject("Scripting.FileSystemObject")
Set file1= filesys.GetFile("Money Manager DB.mmb")
date1 = file1.DateLastModified
Set file1= filesys.GetFile("New folder\Money Manager DB.mmb")
date2 = file1.DateLastModified

If DateDiff("s", date1, date2) > 0 Then
    UserInput = Msgbox("Do you want to update the local MMEX database from the Dropbox?", vbYesNo, "Update from Dropbox?")
    If UserInput = vbYes Then
        filesys.CopyFile "New folder\Money Manager DB.mmb", "Money Manager DB.mmb"
    End If
End If

Set sh=CreateObject("Wscript.Shell")
' sh.Run  """C:\Program Files\MoneyManagerEX\bin\mmex.exe"" ""N:\financial\Fred\Financial\Money Manager DB\Money Manager DB.mmb"""
sh.Run  """C:\Program Files\MoneyManagerEX\bin\mmex.exe"" ""Money Manager DB.mmb"""


When run and MMEX transactions updated, I get the following popup error (from MMEX) on closing the application:

"Failed to copy the file 'Money Manager DB.mmb' to 'Money Manager DB.mmb_update_2015-11-12.mmb (error 2: the system cannot find the file specified)"

There is no such problem when updating this mmb from MMEX when started normally from the desktop icon.

Has anyone else had a similar problem, am I doing anything incorrectly, have I unearthed a bug?

Re: Calling MMEX from script.

Posted: Thu Nov 12, 2015 6:14 pm
by GabrieleV
Why you don't directly open Dropbox MMB?

Inviato dal mio Nexus 5

Re: Calling MMEX from script.

Posted: Thu Nov 12, 2015 10:05 pm
by Sherlok1948
Thanks for the reply GabrieleV.

Not what I want to do. I want to give the user:

1) The option of updating or not updating the local mmb file from the dropbox before invoking MMEX then to

2) Either update or not update the dropbox after udating and closing MMEX,