A tool that does this has already been written.
http://eq2interface.com/downloads/in...atControl.html
It's only in French, but I was able to use it pretty easily. You can also use it to re-order the channels, which is convenient if you're trying to get them set up uniformly across multiple characters.