You did not actually say so but I assume that c:\test.log
does not exist, indicating that the job never ran, or that
the user account you used does not have write-access
to both c:\test.log and c:\test.bat.
Your results are at variance with the results I observe on
one of my own machines, working with an ordinary user
account that I created specifically for the purpose of this
thread. They are also at variance with all my past observations.
Incidentally, the job I specified in the GUI of the Task
Scheduler was c:\test.bat.
I'm sorry but this is as far as I can take you.
Alexander Grech said:
Hi Pegasus
here is the result, again exit code 1.
"83.job" (83.cmd)
Finished 5/26/2004 11:44:38 AM
Result: The task completed with an exit code of (1).
[ ***** Most recent entry is above this line ***** ]
Pegasus (MVP) said:
The exit code of 1 indicates that something was not quite
right in your batch job. In order to walk before you run,
modify the batch job like below, then post these things:
- c:\test.log
- The task scheduler log file entry
You must also make absolutely sure that you enter the
correct password for the scheduled job.
@echo off
echo %date% %time% %UserName% Start of job > c:\test.log
echo %date% %time% End of job >> c:\test.log
I am signing out now - my time zone is 9 hours ahead
of yours.
"83.job" (83.cmd)
Started 5/25/2004 3:08:00 PM
"83.job" (83.cmd)
Finished 5/25/2004 3:08:00 PM
Result: The task completed with an exit code of (1).
[ ***** Most recent entry is above this line ***** ]
There is nothing wrong with this batch job. Now go to
the Control Panel / Scheduled Tasks / Advanced /
View Log. Use Edit-Find to locate the word "recent". This
should get you to this line:
[ ***** Most recent entry is above this line ***** ]
Now copy & paste the lines above this line into your
next post.
this is the batch file:
@echo off
echo %date% %time% Start of job > c:\test.log
c:\83.vbs 1>>c:\test.log 2>>c:\test.err
echo %date% %time% End of job >> c:\test.log
I use it to run a VBS script which moves files from one folder to
another.
Post the first few lines of your batch file here.
ok, I ran gpedit and now the user has access to log on as a batch
job,
when
I run the task, the scheduler log reports that the task was run
successfully
but the .cmd or .bat file does not execute. the logs are not
created
and
no
files are moved. The bat works perfectly when I double click on
it.
this
happens when I run it under a normal user but not when I run it
under
the
admin or system account. The user is a power user and backup
operator.
could it be that my task scheduler corrupted or I need an update
which
is
not supplied with the service pack?
Did you run gpedit as I suggested?
You should also add some diagnostics to your job:
@echo off
echo %date% %time% Start of job > c:\test.log
YourVBSJob 1>>c:\test.log 2>>c:\test.err
echo %date% %time% End of job >> c:\test.log
Now examine the two log files.
thanks again.
Yes, the user is part of the backup operators group,
which
is
listed,
I
have
added the user too. This error does not happen when I
try
machine.