Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Task scheduler double triggering hourly job - intermittently!

Status
Not open for further replies.

stduc

Programmer
Nov 26, 2002
1,903
GB
I have a little batch job that runs once an hour. Occasionally, roughly once or twice a week, Task scheduler starts the job twice. Naturally one fails, as it tries to access the same file that is already open by the first instance.

Steps taken so far in an attempt to remedy the issue.

I granted myself batch rights.
I switched from "Do not start a new instance" to "Stop the existing Instance" to "Queue a new Instance"

The job only runs for a few seconds.

I have just changed it to "Queue a new Instance" - so maybe that will fix it, but it could be a week or so before I know.

Just wondered if anyone else was having any issues.

Oh, nearly forgot - It's Windows 7 ultimate, 64 bit running on Intel i7 860 2.8 GHz ASUS P7P55D-E Mobo

[navy]When I married "Miss Right" I didn't realise her first name was 'always'. LOL[/navy]
 
No issues that I remember seeing or hearing about. What is the trigger or schedule to launch the batch file? The only thing that comes to mind is that there is some sort of doubling up on the running of the job, maybe your batch file is identical to one of the Windows own automatic scheduled tasks?
 
The trigger is 05:00 repeat every hour for 1 day
The action is runqpipmin.vbs (Not a name Windows is likewly to have I would have thought)
No conditions
Settings are - 'allow to run on demand' and 'if already running queue a new instance'.

I have seen other people reporting the issue, Mainly 64 bit and only "solution" I found was to permit batch jobs (I run it as a normal user). I am beginning to suspect it is a bug in Windows.

The vbs runs a DOS .bat job minimised - one work around would be if I could add an 'on error exit' to the DOS batch. But I don't think that is possible?

[navy]When I married "Miss Right" I didn't realise her first name was 'always'. LOL[/navy]
 
Have you tried ticking the option that allows it to run with the highest privileges (in Task Scheduler) to see if that makes any difference?
 
Yes I have linney. I can't find any combination of triggers and settings that totally prevents the job being started twice occasionally.

I have modified the job to use a "job is running" file as a flag. It checks for the existence of this file at the start and if it exists, exits, otherwise it creates the file and deletes it at the end. This seems to work except if the computer resumes from sleep mode when Windows seems to fire off one job for every hour it has been asleep!

I have to conclude that the job scheduler is broken in Windows 7!

The same job had been running every hour without incident on XP for years!

[navy]When I married "Miss Right" I didn't realise her first name was 'always'. LOL[/navy]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top