There's no real good way to do this if you're running multiple instances because of VFP's requirement for exclusive use - if more than one instance is running tables can and usually are open in more than one session adn you can't re-index properly. In order to reindex/pack properly you need to put the server into single instance mode and then run the maintenance operations.
What I've done to automate this is to basically drive the requests remotely through HTTP. All the operations are accessible via HTTP links, so I use wwHttp to hit first the link to put the server into single instance mode
DO wwhttp loHttp = CREATEOBJECT("wwhttp") loHttp.cUsername = "ricks" loHttp.cPassword = GetSystemPassword() *** Put server into single instance mode (COM only) lcOutput = loHttp.HttpGet("http://yourdomain.com/wconnect/admin/wc.wc?_maintain~MaintMode") *** Now call a server link that runs your admin task lcOutput = lcOutput + loHttp.HttpGet("http://yourdomain.com/wconnect/admin/wc.wc?wwMaint~ReindexSystemFiles") lcOutput = lcOutput + loHttp.HttpGet("http://yourdomain.com/wconnect/admin/wc.wc?wwDemo~Reindex") *** Put the server back into multiserver mode lcOutput = lcOutput + loHttp.HttpGet("http://yourdomain.com/wconnect/admin/wc.wc?_maintain~Load")
Now compile that PRG into an EXE and fire hook it up to task scheduler for specific times when traffic is low or non-existant.
+++ Rick ---
from Maui, Hawaii