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.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

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.
Thomas GrassiSystems AdministratorCommented:
Have you tested the batch file from  a command prompt?

Post you batch file so we can check it out
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
10 Tips to Protect Your Business from Ransomware

Did you know that ransomware is the most widespread, destructive malware in the world today? It accounts for 39% of all security breaches, with ransomware gangsters projected to make $11.5B in profits from online extortion by 2019.

Lionel MMSmall Business IT ConsultantCommented:
Try using a different username, some user that id also an admin user
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.
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.
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
IndyrbAuthor Commented:
Still have issue, I tried about everything.
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
IndyrbAuthor Commented:
it still faqils.....not sure why
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

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.