I ran into an issue when trying to shutdown an un-registered application. Thought I would pass it on, since you may encounter the same. IF a modal form is open, goapp.shutdown didn't work for me. The app remained open. However
keyboard{'ctrl+F12'}
worked great.
You might consider upgrading your backup software. Most aftermarket softwares have no problems backing up "busy" files. I had that same issue years ago trying to use NTbackup. IF I recall correclty, just closing the table was sometimes not enough. I had to reboot the server before it considered the file as 'not busy'. You may want to confirm that before investing time into a shutdown procedure.