Well for that I really think NETDOM would be your best bet.
You can script a call to it and then feed it the required information.

These are for 2000/XP machines correct?

Please take a look here for an OLD example of using NETDOM, I would update the code as it is not 100% solid, but would give you an idea of how to do it.

JoinAD KiXform script to move computers into an AD

Take a look here for potential tools needed and where to download them.

Files/Applications - commonly used