You have to take the window up-down mechanism out to remove the motor.
There should be about five 10 mm bolts to remove. Three is holding the mechanism to the door and two is holding the glass.
Remove these bolts and the wire plug and the mechanism should come right out. Don't let the glass to drop, just lower it slowly.
Then use a big flat screw driver and loosen the 3 bolts holding the motor to the mechanism CAUTION: the mechanism is spring loaded and it can simply bounce back so keep away your fingers around the mechanism. It is not a heavily loaded spring, but just be ready. I keep the mechanism on the floor and with shoes on I step on to it while pressing hard on those 3 bolts and turning.
I don't think there is a programming involved. The AUTO function basically uses a bi-metal to disconnect the power. When the window reaches the top (or bottom), the bi-metal heats up and pops in the other direction disconnecting the power to the motor.
Use Denso or OEM used motor if you plan it that route. These motors hardly fail. Never seen one in my life with a failed toyota-denso window motor.