taskscheduler

I have a task that opens and runs a batch file.

On user I put ion the service account and verified that it can run without being logged on.

The problem is it stops running after about an hour or two, I reput in the password and it runs every 5 minutes like it iws suppose too. then after awhile it stops, until I re enter the password in...

this is on windows 2003


if I use the /u and /p in the command it says it already has a session open and wont run correctly.
LVL 5
IndyrbAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Lionel MMSmall Business IT ConsultantCommented:
without knowing more about what your batch file is doing all I can suggest is to delete the scheduled task and re-create it from scratch; sometimes this is what is needed.
0
Thomas GrassiSystems AdministratorCommented:
Have you tested the batch file from  a command prompt?

Post you batch file so we can check it out
0
IndyrbAuthor Commented:
I have tested the batch file, and it works.
It even works in task scheduler for a period of time, but then fails...

the script is as follows:

openfiles /Query /FO csv /NH /V >> F:\OpenSessionsReport\localserver1_openfiles.txt
openfiles /Query /FO csv /NH /V /s server2 >> F:\OpenSessionsReport\server2_openfiles.txt
openfiles /Query /FO csv /NH /V /s server3 >> F:\OpenSessionsReport\server3_openfiles.txt
openfiles /Query /FO csv /NH /V /s server4 >> F:\OpenSessionsReport\server4_openfiles.txt

the script really takes about 2 minutes (if that)

its scheduled to run every 15 minutes. and like I said it works for a while, then suddenly stops, until I open properties and reput in the password... then it will work for a while more.. it is running as a service account and they are added to admin, and log on as service/batch... and the properties of the task doesn't require the user to be logged on....

I can manually click the script and never have issues....

The problem is once task fails, it never seems to retry again even though its specified,, or perhaps it does retry but always fails until I reput in the password for the service account
0
Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

Lionel MMSmall Business IT ConsultantCommented:
Try using a different username, some user that id also an admin user
0
Thomas GrassiSystems AdministratorCommented:
Just setup your script on my Windows 2003 server.

Ran it several times via command prompt no issues

Set up as a task  ran every 5 mins

Works fine.

I am using the domain user account  for the user.
The same account that is logged on to the server.
0
Thomas GrassiSystems AdministratorCommented:
I just recreated your problem  the command hangs for a long time until I did a control C then typed a Y

If you run the command from a sub directory this happens.

When I run it from the root of c then it runs

put a cd command in the script to make sure the job starts in the root of c drive.
0
IndyrbAuthor Commented:
it still fails... I moved all to c drive and updated batch file accordingly. still fails every so often, until I put in password again
0
IndyrbAuthor Commented:
Still have issue, I tried about everything.
0
Thomas GrassiSystems AdministratorCommented:
Have you tried running this from one of the other servers?

I moved my script to another server and it did not fail
0
IndyrbAuthor Commented:
it still faqils.....not sure why
0
Thomas GrassiSystems AdministratorCommented:
How about running the script with just one command line


Create a deeper ate script for each command line
Create a separate task for each script

See which one fails
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Server 2003

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.