Calling MMEX from script.

Page 1 of 1
5 posts
Calling MMEX from script.

Sherlok1948
New MMEX User

Posts: 10
Joined: Thu Dec 29, 2011 3:38 pm
Is there a Command Line Interface so that I can start MMEX from  vbscipt with a specified database?
Re: Calling MMEX from script - SOLVED

Sherlok1948
New MMEX User

Posts: 10
Joined: Thu Dec 29, 2011 3:38 pm
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!

Sherlok1948
New MMEX User

Posts: 10
Joined: Thu Dec 29, 2011 3:38 pm
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.
User avatar
GabrieleV
MMEX Developer

Posts: 266
Joined: Wed Apr 09, 2014 1:45 pm
Location: Italy
Why you don't directly open Dropbox MMB?

Inviato dal mio Nexus 5
Re: Calling MMEX from script.

Sherlok1948
New MMEX User

Posts: 10
Joined: Thu Dec 29, 2011 3:38 pm
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,
Page 1 of 1
Who is online

Users browsing this forum: No registered users and 3 guests