Jump to content

Recommended Posts

Posted

Hi,

 

Apologies if I miss any rules, this is my first post.

 

I have written a console app in .NET which calls creates a param file and calls CommandReporter with it and it works perfectly pulling out the reports in to XML.

 

However, when I run the app via Task Scheduler it breaks every time trying to run CommandReporter.

 

Are any known issues with this?

 

Thanks

Posted

Worth checking the user privileges the task is running under. I would think it has to be someone with the ability to run it manually / have access to the shared drive for SIMS etc.

You should be able to see some info in the event logs, or directly in the task log that might give a clue.

  • Thanks 1
Posted (edited)
vikpaw Thanks for your thoughts. I am installing the app and running the task scheduler under an Administrator account with full privileges so I don't think that is the problem, but I will look again. I've checked the error logs and no error is shown. I am 95% sure it is an issue with .NET and command line arguments with spaces and the use of quotation marks. Edited by grayson
Posted

I just checked a disabled task that i had set up previously.

The program it runs is : "C:\Program Files (x86)\SIMS\SIMS .net\CommandReporter.exe"

with arguments : /servername:\ /databasename:sims /user:simsadmin /password:******** /report:"BISJ - Oliver5 Export +" /output:"\\oliver5\e$\Program Files (x86)\Softlink International\Library Server\UserDefinedLocations\newstudents.csv"

 

It runs as a high privilege admin account. The sims user in the arguments is a member of all usual groups including third party reporting and i can log in manually to sims with that user to test the report. Obviously your report won't be the same, but you can test manually, which i presume works as your app works.

 

Worth comparing what your app runs compared to how i've got it configured in task scheduler, it could be something wrong in the syntax.

  • Thanks 1
Posted

vikpaw. Great idea. I am running my app from the task schedule so my entry in the task scheduler is c:\mydirectory\app.exe. Inside app.exe it then runs the command line with commandreporter and the relevant params.

 

I can try and take the line from my code with the parameters and just run it with commandreporter like you have and at least see if that works. I also don't have /servername\ /databasename:sims in my command line parameters. will try that too. Not quite sure about the servername/instance syntax but will dig a little more to learn.

 

Thanks again.

Posted

Oh I see what you're doing. Yes definitely try to schedule just CR. if that works okay then it's how the app runs that is at fault.

Is it possible the app is using relative references to find command reporter? So something about how it runs as a task is causing it to not see or find something it needs.

Maybe you can add in some debug code to write to a text file so you can see how far it gets, or doesn't it do anything else?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...