Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Friends
We have a Dashboard wherein I have a VB Script macro which exports a report to PDF and emails to the users.
It works find when run manually.
When we trigger the application reload with the help of a Batch file (.bat file) it reloads the application successfully and also generates the PDF report in desired folder. However it does not sends the Email. (Have used OnPostReload --> Run Macro)
Batch File -----> Reload the Application --> OnPostReload -- > RunMacro ---> Send PDF report email.
The above scenario runs well when we manually reload the dashboard. The email is sent successfully once macro is triggered after reload.
However the email is not sent when we reload the dashboard with batch file. Only the PDF is generated in given path.
Is there something we are missing to get the emails sent while relaoding the dashboard with batch file?
Kindly help to resolve above issue. Let me know if you need any further details.
Thanks & Regards
Chintan Gala
It may be running as default user, not aware how to set the context for the task scheduler.
Kindly help how can we set the same.
I mean these settings within the task-planner:
- Marcus
Hello Marcus
The Windows Task scheduler is running with admin privileges.
Kindly find atatched screenshot -- task_scheduler.
Thanks & Regards
Chintan Gala
Unfortunately for me it never worked without a user-login and therefore I use the first option like in my screenshot. Pure logically it should also work with the other options but I think there are some essential settings or configurations missing and I'm not admin enough to find the real cause (and my workaround with the login works well since years). Maybe pcammaert could shed some light.
- Marcus
Thanks Marcus. I will also try with the same settings as in your screenshot .
Meanwhile could you route this thread to others who may provide necessary settings required to resolve this.
Thank you again for your time and insights provided.
I'm not really sure how I can be of help. I should note that I switched to using/promoting/supporting NPrinting a while ago, mostly for reasons of reliability and easy of deployment.
Chintan, is the macro reponsible for generating the PDF and sending the email?
I agree that using NPrinting will be in many cases a more reliable and cost-effective solution as to fiddle with all the macro-stuff and how to execute it properly.
I hoped you could give a hint why (at least in my case) it only worked when I'm logged in - all other options failed and I think the reasons are some missing configurations / rights but I have no idea which one it could be.
- Marcus
Dear Peter
Yes, the macro is responsible for PDF generation and emailing the same.
The PDF gets generated but email is not being sent.
If we reload the application manually it also sends the email successfully.
But if we schedule batch file to reload the application, it only generates the PDF in folder but does not send email.
Thanks & Regards
Chintan Gala
Then you will be able to capture failure information in your macro. If your system isn't able to forward your email for any reason whatsoever, it should indicate this by returning an error code or some kind of failure response. That will be helpful for figuring out where exactly we need to look for missing configuration information, or insufficient privileges or whatever.
Without this kind of information, it will be like shooting in the dark.
Hello Peter
Okay you mean we need to capture the logs by putting some script in the macro?
currently we are not using anything in the script to capture the logs.
Thanks & Regards
Chintan Gala