No easy way. But it can be done.
Method 1: shutdown script
Easy and pretty dumb - but will work for sure:
Create a short script:
line1 - run the backup command (you can use robocopy for file copy from point a to point b or you can be more advanced and run a full backup using wbadmin.exe and its parameters)
line2 - run the shutdown command (something like "shutdown -s -t 0")
Run the script for computer shutdown.
Method 2: task scheduler
The trick is that if you want to use she normal shutdown button and not a stupid script, then you have to use the windows to hook to the shutdown event.
Use the task scheduler to execute a backup script/command (like wbadmin.exe with some parameters) on shutdown event (look in your event log for the correct event ID). Not sure it will work as if the backup take more than a few seconds, Windows shutdown procedure might kill it (you can still try and let us know).
Method 3: local group policy
Use the local group policy to execute script on shutdown:
1) run gpedit.msc
2) navigate to Computer Configuration > Windows Settings > Scripts (Startup/Shutdown)
3) put there whatever you want (again script/command with parameters)
Method 4: registry
The most advanced method (similar to the #3, but no nice GUI):
Save the following text as a text file (between the lines and without them):
-------------------------------------------------------------
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Shutdown\0]
"GPO-ID"="LocalGPO"
"SOM-ID"="Local"
"FileSysPath"="C:\\Windows\\System32\\GroupPolicy\\Machine"
"DisplayName"="Local Group Policy"
"GPOName"="Local Group Policy"
"PSScriptOrder"=dword:00000001
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Shutdown\0\0]
"Script"="c:\\abcd.exe"
"Parameters"="-a -b /c /d"
"IsPowershell"=dword:00000000
"ExecTime"=hex(b):00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
---------------------------------------------------------------
Edit the contents to replace the script and the parameters with whatever you want. Note that the registry uses double \\ instead of a single one. For reference, the command that will be launched on shutdown using what I've pasted in the example:
"c:\abcd.exe -a -b /c /d"
I use Windows 7, not sure if it will work on others (however it should work even on XP).
Re-save the file as a .reg extension (if you use notepad, put the file name between "" to prevent the notepad adding a .txt automatically). Then launch the reg file and confirm you want to merge it into the registry. Make sure to backup your registry:
http://windows.microsoft.com/en-MY/windows7/Back-up-the-registry
Bottom line:
If I were you, I'd go with 3 if possible - it's the easiest one (but if you have a "home" version, you don't have the gpedit.msc snap-in...).
Disclaimer:
If you mess up your computer - it's your fault. As a general rule, you should never execute something you don't understand/don't know where it came from/don't trust the origin.
Cheers,
Leonid