I have a program that I need to run at shutdown (after you click shutdown or restart from the menu). Does anybody know the code to do this and when I would have to load the program up in the first place (run the program at Startup and then it know when the computer is shutting down. Also I guess I need to know how to stop the computer from fully shutting down until my program is done and one it is done, how to let the computer continue shutting down! Phew!

thanks for everything!