1.

Solve : Batch Files, Logic, and Time?

Answer»

Forgive me. I'm new to these forums, and to the Batch file deal... Grew up with computers, and if I knew about batch files back when I was a budding geek at the age of 14, I'd know what I was doing now...Only I didn't...So...

Can someone show me an example of batch file for DOS that operates only if it is a particular time of the day? I would like to create a file that uses logic, and operates only between the hours of 7:00 am and 9:00 PM... At 9:00 pm, the computer would exit the batch job... What do you think? Is this DUMB?

BTW - I have looked at your "Batch File Help" page, which has proven useful beyond belief, but I don't think this issue is addressed.

Thank you!
If this is a windows OS, you could use the task SCHEDULER. Schedule the job to start at 7AM and then on the SETTINGS TAB, have it commit suicide after running for 14 hours.

If the batch file launches a secondary program, then you would have to schedule the launched program thru the scheduler not the batch file. You could get really imaginative and have the batch file scheduled to run at 6:55AM and put the lauched program on the schedule for a 7AM start ("AT" command)

If this is a DOS machine, then there is no scheduler and batch language does not have any facilities to do this.

Good luck.



Discussion

No Comment Found