How to schedule a task to run when shutting down windows

windows, windows-xp

Solution

Execute gpedit.msc (local Policies)

Computer Configuration -> Windows settings -> Scripts -> Shutdown -> Properties -> Add

Problem

How do you schedule a task in Windows XP to run when you shut down windows. Such that I want to run a simple command line program I wrote in c# everytime I shut down windows. There doesn't seem to be an option in scheduled tasks to perform this task when my computer shuts down.

Original source