I made this in VBScript:
Set oVFP = CreateObject("VisualFoxpro.Runtime.7")
oVFP.DoCmd("Open Database c:\cache.dbc Exclusive")
oVFP.DoCmd("Pack Database")
And I got this error:
C:\wintemp\a.vbs(3, 2) Microsoft VBScript runtime error: Object required: 'oVFP'
Then I tried this in the VFP7 IDE:
oVFP = CreateObject("VisualFoxpro.RunTime.7")
And I got this error:
OLE error code 0x80004002: No such interface supported
I ran COM Explorer and see that under DLL servers there is a ProgID of "VisualFoxPro.Runtime.7" and it points to c:\program files\common files\microsoft shared\vfp\vfp7r.dll, something is just not quite right. I like your idea of instancing the runtime, I just can't get it to work. :)