I noticed, that the HS4 APPLICATION under "Tools Menu-Setup Menu-Custom Menu" shows Startup.vb which runs fine, and has a field for adding a Shutdown script, which I edited as Shutdown.vb, but the Shutdown.vb doesn't save or execute when HomeSeer shuts down.