I want to run an executable that saves an XML file on a local drive before the computer (running on Windows 7) gets shut down.
I know it is possible to run scripts before shutdown. This can be configured in Local Group Policy Editor under Computer Configuration --> Windows Settings --> Scripts(Startup/Shutdown).
I have tried to put my executable in the shutdown property, but it does not work. How can I run an executable before the computer gets shut down? How can I hook up the shutdown event?