Advertisement

11.20.2008 at 12:53PM PST, ID: 23923104 | Points: 500
[x]
Attachment Details

Running a batch file as a service using srvany

Asked by RenLearn in Windows Batch Scripting, Scripting Languages, Server Applications

I am using srvany to run a batch file as a service.   I am able create the service, but when I attempt to start the service I receive this error:  The service on the Local Computer started and then stopped.  Some services stop automatically if the have no work to do, for example, the Performance Logs and Alerts Service.

The batch file executes a robocopy command that copies files from one server to the other server using different parameters.  The batch file will execute with zero mistakes when I run the file as a scheduled task or when ran manually, but it will not run when I run the file as service.  In an attempt to resolve this issue I tried both running the service as local system account using a command in the batch that provided the user account to run the file under.  I then attempted to run the file using domain admin account.  Both attempts resulted in the same error.

In desperation I attempted another fix.  This fix had me increase Application log file size.  I did this and it did not help.

Any advice on this matter would help!

Thanks,

JJ


Start Free Trial
[+][-]11.20.2008 at 01:51PM PST, ID: 23008692

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.20.2008 at 02:42PM PST, ID: 23009119

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11.20.2008 at 02:43PM PST, ID: 23009130

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081119-EE-VQP-49 - Hierarchy / EE_QW_2_20070628