| 1. |
Solve : set time in batch + 10sec more!? |
|
Answer» hi i want set current time + adding 10 second more to my batch file, like: Like Dave asked, why are you doing it that way, and not using a simple 10 second delay? Quote from: Salmon Trout on August 09, 2011, 11:56:56 PM Like Dave asked, why are you doing it that way, and not using a simple 10 second delay?because in "AT" command you must set time, you can't use delay! But you want it to happen in 10 seconds time. So why use AT? Quote from: behzad-007 on August 08, 2011, 04:32:48 AM i don't want 10 second delay! It doesn't make sense. Why do you need the scheduler and not use a time delay as suggested? Does the AT command even support seconds? The system scheduler (GUI) does not. Batch code does not really do date/time computes very well. All data is seen as a string, so even though you can do integer arithmetic, you run into that pesky problem of the seconds possibly carrying over to the next minute which in turn can carry over into the next hour and so forth. Pretty soon it's next year and then where are you? VBScript can handle the date/time arithmetic and there is a CLASS for the AT scheduler. You could always count one Mississippi, two Mississippi etc. When you get to ten Mississippi launch the missiles command. If you use military cadence, you can improve the ten second precision.Quote from: behzad-007 hi Judging by this, I am not convinced he knows the difference between seconds and minutes. Hi Sidewinder, I agree with you. Both AT and SCHTASKS don't support seconds at all. Yes, it's difficult to calculate data/time in batch code, especially we need consider the next hour/month/year and leap-year. But we can use Epoch. You may want to have a look at the fuctions of Ritchie Lawrence. http://www.commandline.co.uk/lib/treeview/index.php |
|