Here is an app that will shut down windows by the time specified. I have posted the [Source] and the app.