Sorry - I only used this method for a very short period of time, so I can't remember if I had it in my base image or copied it with the unattend.xml during provisioning.
The script is AutoIt, so you need to compile it as such. Yes you do need the #includes in the script and also need the au3 files referenced when you compile it as an exe.
From my message above:
The script I put together using Autoit and _XMLDomWrapper is below if anyone wants to use it. Pull it into the editor in this format with the _XMLDomWrapper.au3 and Array.au3 includes available and compile it into an exe.
Google "AutoIt" and you'll find a wealth of resources including some pretty decent support forums.