![]() Next, the Task Scheduler doesn't seem to properly end the task even with all end/stop task after 1 day things are set. This makes it only wait 2 seconds for failure, and ping for 86400 times (1 day's worth of seconds, may get slightly less if it pings well all day, or slightly more if request timed out, but close enough). I made modifications to the first ping command. But I've not used it so can't comment on how well it actually works.Īlthough I haven't found a time-based termination of the batch (at 11:59pm, terminate), I did manage to do a work-around that will be good enough for me. If you want you might also be able to use schtasks to initiate the task via cmd or another script if needed. ![]() Since it's now a new instance of the script it will pick up the new date, and therefore output the results to a new file with the current date. That combination should mean that you can start the script whenever you want, then at midnight a new instance of the script will be started on schedule which in turn stops the previously running instance. In Settings, make sure Allow task to be run on demand is ticked (so you can manually start it when required), then at the bottom change Do not start a new instance to be Stop the existing instance. Unfortunatly I suspect the only work around that will do it (unless someone comes up with a better idea) is to use Task Scheduler to handle stopping and restarting the script each day.Ĭreate the task and in Triggers set it to run Daily at 00:00:00 I think the issue is that while cmd /v enables delayed environment variable expansion, and that allows the date + time you're outputting to file to remain current, that doesn't apply to the filename you're piping the results to, and I can't think of a way around that. It's an interesting question, spent over an hour last night trying to come up with a solution within the script.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |