Run a script only at shutdown (not log off or restart) on Mac OS X

Few days ago I published on github a configuration/script able to be executed at boot/shutdown. Basically on Mac OS X you could/should use a System wide and per-user daemon/agent configuration file (plist) in conjunction with a bash script file. This is a sample of the plist file you could use: <?xml version=”1.0″ encoding=”UTF-8″?> <!DOCTYPE plist … Read more

C# – How to detect a Windows shutdown/logoff and cancel that action (after asking the user)

There is a static class called SystemEvents that exposes this behaviour: http://msdn.microsoft.com/en-us/library/microsoft.win32.systemevents.aspx However, it cannot differentiate between certain actions and doesn’t pause the OS process time-out guard. I used it once, but the default time-out as configured in the registry is a little short so will likely need increasing. To cut a long story short, … Read more