I am writeing a simple app that displays a message telling the user to turn off the moniter etc before the user shuts down the system. Could someone exlpain how I can run the app at shutdown. The app also has to be iinstalled on a large network, is there anyway of installing it on all the machines at once.
Thanks

Starting apps at shutdown
GoingNCircles
Hi Rob,
Take a look at the ClickOnce delivery system. It's designed to enable applications to be installed from remote machines as and when they are updated.
I am unsure as to what style of application you are creating, but if you can have a form loaded in it, a simple way to detect a system shutdown would be to handle the FormClosing event and check the value of the FormClosingEventArgs.ClosingReason property. One of the possible return values is WindowsShutdown. I have never used it myself so cannot contest to its accuracy/reliability/usage etc, but it might be a good starting point for you.
If the above is not a suitable solution, please give a little more information on your application and I'll see if I can help some more.
Richard
Mandragon
Thanks,
That seems to work. Another problem that's appeared is the machines that the app will be installed on is using an older version of the .Net framework and an error saying it can't find the framework. This is because it's looking for it in the folder "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727" which does not exist instead it should point to "C:\WINDOWS\Microsoft.NET\Framework\v framework version". Do you know of a way around this without installing the newer version of the framework.
DaPosh
Hi Rob
If your application has a dependency on version 2 of the framework then this must be installed on the machine your application runs on.
Richard
MusicMan2006
Here is a post of mine about running apps at shutdown. I haven't tried it out, but it might point you in the right direction:
http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=1132443&SiteID=1