You need the resource kit utility called Shutdown.exe. This tool might also come with the support tools in the SupportTools folder of your original CD. It does come with the Windows XP support tools. Then, schedule a task to run the command "shutdown -r" at midnight.
This was first published in July 2002