Scheduled Tasks

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

For the life of me, I can't seem to consistently make a scheduled task work.
Not sure what I am doing wrong.

I have a .bat file that basically runs an xcopy command with an echo
statement. The .bat file has been tested and works fine.

I put the .bat file on the root of the C directory. I then run a "new
scheduled task" from the Scheduled Task window and browse for that file. I
accept all defaults and set a daily schedule.

It doesn't run automatically on about half of the computers that I try to
run it on.

Am I missing something? Arggghh.

Joe
 
Scheduled Tasks|Advanced|View Log may provide some details. If the job
connects to another machine you may need to add the user/ group 'logon as
batch job' rights (server side). Control Panel|Admin Tools|Local Security
Policy\Local Policies\User Rights Assignments
"Log on as a batch job"

Remember that if it involves network resources to make sure the user account
has permissions to the resources and also use UNC paths as mapped drives
won't exist when no one is logged on.

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect
 
Joe said:
For the life of me, I can't seem to consistently make a scheduled task work.
Not sure what I am doing wrong.

I have a .bat file that basically runs an xcopy command with an echo
statement. The .bat file has been tested and works fine.

I put the .bat file on the root of the C directory. I then run a "new
scheduled task" from the Scheduled Task window and browse for that file. I
accept all defaults and set a daily schedule.

It doesn't run automatically on about half of the computers that I try to
run it on.

Am I missing something? Arggghh.

Joe

Add some basic logging facilities to your batch file like so:

@echo off
echo %date% %time% Start of task > c:\test.log
echo User=%UserName%, Path=%path% >> c:\test.log
c:\Tools\YourTask.exe 1>>c:\test.log 2>c:\test.err
echo ErrorLevel of c:\Tools\YourTask.exe=%ErrorLevel% >> c:\test.log
echo %date% %time% End of task >> c:\test.log

Now let the task run, then examine the two log files and all will
become clear.
 
Back
Top