After fixing a couple of typo's
i ran the script and i get "
Microsoft VBScript runtime error: Object required: 'IsRunning'" with MM4 running or not on the line "Set x = SDB.IsRunning"
I had tried a variation of what you're suggesting as follows:
Code: Select all
Dim SDB
Set SDB = CreateObject( "SongsDB.SDBApplication")
Wscript.Echo ("SDB IsRunning before loop :" & SDB.IsRunning)
Do While Not SDB.IsRunning
Wscript.Echo ("SDB IsRunning in loop :" & SDB.IsRunning)
SDB.ProcessMessages
Loop
Wscript.Echo ("SDB IsRunning after loop :" & SDB.IsRunning)
SDB.ProcessMessages
Wscript.Echo ("SDB IsRunning after PM :" & SDB.IsRunning)
SDB.ShutdownAfterDisconnect = False
Wscript.Echo ("SDB SAD should be False :" & SDB.ShutdownAfterDisconnect)
SDB.ShutdownAfterDisconnect = True
Wscript.Echo ("SDB IsRunning after SAD :" & SDB.IsRunning)
Wscript.Echo ("SDB SAD2 should be True :" & SDB.ShutdownAfterDisconnect)
and i get the following:
SDB IsRunning before loop :True
SDB IsRunning after loop :True
SDB IsRunning after PM :True
SDB SAD should be False :False
SDB IsRunning after SAD :True
SDB SAD2 should be True :True
So in summary, i can start MM4, get the IsRunning status and set ShutdownAfterDisconnect but it does not shutdown MM4. BTW, i've tried this on my primary MM4 PC and a development laptop.
Still no luck shutting down MM4 from a script.