Closing applications might be tough because it's hard to tell what is an application and what is a service from an automated script.
What about just logging off? You can enable a screen-saver that forces a logoff (in case you forget). Logging off leaves the OS running, but with no applications running (only services).
Check here to get started:
http://windowsxp.mvps.org/winexit.htm