Click here to Skip to main content
15,889,200 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

can anybody help me, as I'm not getting any solution for my problem.

Question:
I have a batch script, which is generating XMLs by fetching data from DB. This is working perfect when, I will go to the server and double click i.e. execute that Batch file.
But I want to call this batch file from my windows service running on same server. I tried to run the service with a generic account with Admin rights on that server. But still it's not giving results/creating XMLs i.e. output files.
Please somebody help me in this?
Many Thanks in advance.

What I have tried:

I have tried to run the service using generic service account with admin rights. But still it's not working.
It's not giving any errors, just it's not generating XMLs.
Posted
Updated 9-Jan-17 22:25pm

1 solution

If you're using Windows authentication in the SQL Server then you need to ensure that the service is run using a domain account that has access to SQL Server or is a member of a group that has access.

Also ensure that this account has proper privileges to the target folder just like SYSTEM would have.
 
Share this answer
 
Comments
prakashdpwr 11-Jan-17 22:49pm    
Thanks for your reply.
But it didn't worked. I have given all the rights to the account. I tried using my creds to run the service.
Wendelius 11-Jan-17 23:30pm    
Try adding logging to your code.

Catch any exceptions and, if needed, write details from the code in order to know which code is executed and so on.

Write this info for example into a file in C-drive or some other proper place. This will help you to get details about the problem and possible exception.
prakashdpwr 13-Jan-17 7:17am    
I've put try-catch blocks and arranged logs, but can't find anything. :(
Wendelius 13-Jan-17 7:42am    
In case of an exception, do you write the exception to the log?

Also add rows to the log based on the program logic so that you can follow what the program has done by reading the log file. If we don't get some concrete piece of code and/or information about an exception, we're just guessing.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900