|Here's an outline for a batch file that runs continuously (every 5 minutes). You can use the CHOICE command from Vista, but as you are running XP, you can google it and download it as a separate command. CHOICE allows you to prompt if you want to exit, but also has a timeout so it carries on after a specified period (say 5 minutes.)|
When it first runs, search for sunrise and sunset for today's date (as shown in my previous code).
If it's before sunrise, call night.bat and go to :waitforsunrise.
Otherwise, if it's before sunset, call day.bat and go to :waitforsunset.
Otherwise it's night again so call night.bat and go to :waitformidnight
In each of these three labels, use the CHOICE command to prompt for user exit but also use a timeout. After the timeout, check the current time and if it's passed the required time do the appropriate thing and go to the appropriate label. (e.g. in waitforsunrise, call day.bat and go to waitforsunset)
And here's another way to do it. Have a batch file scheduled to run at midnight (00:00) every day, which reads the sunrise and sunset times for that particular day and schedules the batch files day.bat and night.bat to run once for that day at the appropriate times.