How to schedule a task to run daily in the morning next day before reaching office?

0

Hi I want to schedule a task to run automation on virtual mavchine atleast 3-4 hours after I leave my office. I have made a .vbs file which opens QTP and execute the scripts and even I have made a script to stop my vm from autolock. But the problem is when I am setting task scheduler say for 2 hrs after I lock my PC it doesn't work.But if I schedule it for after 15 minutes it triggers.Please any suggestions?? If there needs to be some changes in the settings or anything else.

Thanks, Abhishek

Abhishek Garg

Posted 2015-10-15T11:09:16.470

Reputation: 1

Is your computer set to enter standby after X minutes? Once in standby many things are ignored, I'd try removing the timeline for standby all together and try again. – Centimane – 2016-01-20T16:40:43.613

Answers

0

It should work and in fact it does work when you delay for 15 minutes after logoff but not when you delay for three hours. I am going to propose a work around until we can get some more information and determine the cause of the failure. The work around is to have your logoff script write a "sentinel" file that contains the time of the logoff in it. Create a second task and schedule it to run once per hour. The second task looks for the sentinel file, if not found it ends. if the sentinel file exists it compares the current time to the logoff time in the file. If it has been less than your threshold (3 hours), the task ends. If the delay threshold is exceeded it performs your scripts and deletes the sentinel file so that the scripts will not execute again. One final step would be to create a logon script that deletes the sentinel file, if present, when you logon. This would only come into play if you logged off, were heading home and remembered you forgot to do something and logged in again before your overnight process had run.

The rest of this is a comment not an answer, I don't know the SE protocol for that. In terms of answering the question of why doesn't your "delayed logoff trigger" work after fifteen minutes, maybe I should leave that to others that have experienced it, I have not but, I would think that spelling out what VM you are running and what guest OS you are running under it would be useful in that regard. I would ask you to create your scenario on a real machine instead of a virtual one. If it works real and fails virtual we can focus on the virtual aspects, if it fails real as well as virtual, then we can concentrate on windows. I am also curious as to how you know that it "did not trigger" vs it triggered but did not do anything. I am assuming that you know that by looking at the "last run" column and that if you set the trigger delay at 15 minutes, last run is updated to 15 minutes after you logged off but if you set the trigger delay for 3 hours, the last runs stays what it was before you logged off.

Ted Cohen

Posted 2015-10-15T11:09:16.470

Reputation: 101