Windows Task Scheduler not working

G

Guest

Hi,

I am using the Windows Task Sheduler to run a job every 5 minutes. I
basically have a java program which runs every 5 minutes and I schedule it
using the task scheduler as a back-up plan in case the job fails to execute.
My problem is everytime, I disconnect from the remote desk stop connection,
the java program stops executing. So I thought of using the windows task
scheduler to kick-off the job at a certain time with the expectation that it
will run indefinitely in the background. However, it stops to run at a
certain time. The login credentials I used was the local admin account. I ran
the job manually to ensure that the login that I use has the necessary
permissions, and it was successful. Checking the logfile of the task
scheduler, I encountered an error code '0xc000013a'. I looked it up and it
means that the application terminated as a result of a CTRL+C. So, I wonder
who has been stopping this application. I believe no one has been accessing
the server remotely except myself and I am not stopping it but the job stops
by itself.

Any insights?

Thanks in advance.
 
P

Pegasus \(MVP\)

Iris said:
Hi,

I am using the Windows Task Sheduler to run a job every 5 minutes. I
basically have a java program which runs every 5 minutes and I schedule it
using the task scheduler as a back-up plan in case the job fails to execute.
My problem is everytime, I disconnect from the remote desk stop connection,
the java program stops executing. So I thought of using the windows task
scheduler to kick-off the job at a certain time with the expectation that it
will run indefinitely in the background. However, it stops to run at a
certain time. The login credentials I used was the local admin account. I ran
the job manually to ensure that the login that I use has the necessary
permissions, and it was successful. Checking the logfile of the task
scheduler, I encountered an error code '0xc000013a'. I looked it up and it
means that the application terminated as a result of a CTRL+C. So, I wonder
who has been stopping this application. I believe no one has been accessing
the server remotely except myself and I am not stopping it but the job stops
by itself.

Any insights?

Thanks in advance.

Your post is unclear.
- What exactly does the scheduled task do? Please show the
command line!
- What sort of connection do you have to the remote PC?
- What do you mean with "I disconnect from the remote desk
stop connection"?
 
G

Guest

Hi,

(1) What the scheduled task do is to trigger a java program. The java
program creates a user's account in the server's local directory. What I
basically do is to create a '.bat' file to execute the java program and
schedule it using the task scheduler using the local admin account.

The '.bat' file looks like this.

***************************D:
cd ..
cd ..
cd DCNG_LD
cd build
java com.pg.dcng.DcngScheduler
***************************

(2) I connect to the server remotely using a remote desktop connection. Use
the local admin account and schedule the task.

(3) When I say 'disconnect from the remote deskstop', I mean to close the
connection but not log-off as the user so the program will continue to run.
However, what happens is when I 'disconnect from the remote desktop', the
java program ceases to run in the background. So, I tried to schedule it
using the task scheduler to run at a specified time to run indefinetly even
without a user is logged on. However, it stops in the middle. I receive the
'0xc000013a' error. I would like to know what has been causing this
'0xc000013a' error.

Thanks.
 
P

Pegasus \(MVP\)

The first four lines or your batch file look like so:
cd ..
cd ..
cd DCNG_LD
cd build
java com.pg.dcng.DcngScheduler

They are all based on the assumption of being on
a certain drive in a certain folder. The assumption is
probably wrong. A far more robust coding approach
would look like this:
cd /d "c:\DCNG_LD\build"
java com.pg.dcng.DcngScheduler

As a next step you must add some diagnostics so that
you can see what's happening:

@echo off
echo %date% %time% Start of task > c:\test.log
echo User=%UserName%, Path=%path% >> c:\test.log

cd /d "c:\DCNG_LD\build"
echo Current folder=%cd% >> c:\test.log
java com.pg.dcng.DcngScheduler 1>>c:\test.log 2>>&1
echo Java ErrorLevel=%ErrorLevel% >> c:\test.log
echo %date% %time% End of task >> c:\test.log

I suspect that a careful examination of c:\test.log will show
you what's causing your problems.
 
E

expert-services

When you scheduled the task, were you logged in as local account or
network account? When you schedule you have to use the same account as
you are logged in.

I know you mentioned that you ran the job manually and it worked so it
must be ok. This is one more thing to check.

Tethys Solutions, Expert Services Group
http://www.tethyssolutions.com/ask-the-expert.htm
SMART Macro & Automation Software
 

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