Scheduled Tasks simply not working

J

JOHN MCCARTHY

Created a .bat file and then used "Scheduled Tasks" to
execute the file. The .bat file does not execute nor any
other .exe files. Yes the service is running.

Any help please. W2k SP4
Thanks
John
 
V

*Vanguard*

"JOHN MCCARTHY" said in news:[email protected]:
Created a .bat file and then used "Scheduled Tasks" to
execute the file. The .bat file does not execute nor any
other .exe files. Yes the service is running.

Any help please. W2k SP4
Thanks
John

Do the tasks run when you right-click on them in Task Scheduler to then select Run (to run it now instead of whenever it is scheduled)? Are you trying to run the task under a different account then under which it was defined?

They won't run unless the account to which they are associated is logged in. If you define scheduled events but you are not logged in then they don't run - unless you configure them to run on Windows startup (and you might also have to use RunAs if the account under which you define the event is not an administrator account). That's because your account, by default, is the one that is assigned to run that event, and if you are not logged in then the event doesn't run. I found that out when I asked Symantec why Norton Anti-Virus wasn't getting updated when I wasn't logged on. Their event was defined under my account and my account had to be logged in for that scheduled event to run. Enable the option to alert you of missed events. Then when you login, you'll see which ones needs to be reconfigured. If events ran at the scheduled time and did not require you to login then there would never be any missed events so this option would never had existed. How could you ever miss an event if it ran whether you were logged in or not (presuming Windows *was* running the entire time)?

If you define a bunch of events under your user account and then later rename your user account, you end up disconnecting from the events defined under your account's old name (http://support.microsoft.com/?kbid=303014). If you use RunAs, the event won't run if the account has no password, like you left blank the Administrator password. This problem is only listed for Windows XP but it might also apply to Windows 2000.

Do not have events scheduled to run at the same time (http://support.microsoft.com/?kbid=272022). Although this might have been fixed in a patch or service pack, there's no point in slamming your CPU with lots of concurrent scheduled tasks if they can be spaced out. You'll create a bottleneck in the processor which can only do so much at a time resulting in your tasks taking longer to complete, and they could possibly interfere with other's operation. For example, don't schedule a defrag and then sometime during its execution then also schedule a ..bat file to empty out your temp directories, along with running a virus scan, and so on.

I got tripped up on this, too, in not knowing that I had to be logged in to run a scheduled task. But since LOTS of accounts can be defined both locally and in a domain on an NT-based Windows, imagine the chaos if you let everyone's scheduled tasks run. Joe has a defrag scheduled at noon because he works nights but Martha comes in days and wonders why there's so much disk thrashing going on. It is also possible to schedule an event to shutdown your computer (just right the right utility). That would really piss off someone that was working on the computer at the time.

--
________________________________________________________________________
***** Post your replies to the newsgroup. Share with others. *****
E-mail: lh_811news [at] hotmail [dot] com
Passcode: "=NEWS="
All e-mail is auto-deleted unless passcode is appended to Subject.
________________________________________________________________________
 
P

Pegasus \(MVP\)

JOHN MCCARTHY said:
Created a .bat file and then used "Scheduled Tasks" to
execute the file. The .bat file does not execute nor any
other .exe files. Yes the service is running.

Any help please. W2k SP4
Thanks
John

How do you know it does not run? Have you tried to add
some simple diagnostics to your task?

@echo off
echo %date% %time% Start of scheduled task > c:\test.txt
c:\tools\MyProgram.exe 1>>c:\test.txt 2>test.err
echo %date% %time% End of scheduled task >> c:\test.txt

Now have a look at the two log files!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top