Running a Console VB app as a schedule task

Posted on 2008-10-21
Last Modified: 2010-05-18
I have a console VB application that will run as a scheduled task just fine when scheduled under my account, but fails under any other account.  I tried a dedicated account with Domain Admin rights and it still fails?  Can someone shed some light on what I'm missing.  

Details:  The program just converts some text files to word documents with some formatting of the text prior to converting to .DOC formats....  All in the same folder.

Thanks in advance,

Scott Thomas
Question by:thomashospital
  • 4
  • 3
LVL 32

Expert Comment

by:Daniel Wilson
ID: 22769417
If you log in under that Domain Admin account, does it still fail?

You'll probably need to add some logging to figure out where it's breaking ...
possibilities include:
  • Hitting a mapped drive that isn't mapped for that user
  • Read or write rights on any of the folders
  • read or write rights on any share being hit
  • Rights to run Word (assuming you're using Word for the conversion)
  • Word requiring user setup before it will behave -- the classic "enter your initials, put in the CD, do jumping jacks while I decide whether to work for you"

Author Comment

ID: 22769583

I logged in under the Domain account and it worked!  What does that tell me?  I can't leave the server logged on under that account.

Thanks for the help!!!!
LVL 32

Expert Comment

by:Daniel Wilson
ID: 22769646
When you run it under Task Scheduler, does it fail to start?  Or break once it is under way?

some information should be available, when looking at c:\windows\tasks ,  under Advanced | View Log
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.


Author Comment

ID: 22776524
The log only shows the task complete with an exit code of (e0434f4d)
LVL 32

Expert Comment

by:Daniel Wilson
ID: 22776644
OK, that means it did start ... but crashed.

Do you have access to the code to add some logging?  

Otherwise ... is it hitting mapped drives?  those are sometimes quite problematic.

does it pop any message boxes?  In a run-silent scenario those can cause problems ... though they usually result in the thing just waiting, not exiting w/ a funny code.

Author Comment

ID: 22779147
I have the code and can add any logging you would suggest.  Just let me know what you have in mind.
LVL 32

Accepted Solution

Daniel Wilson earned 250 total points
ID: 22779755
At key places in the code I'd put stuff like:

MyLogFunction "got to the place that does X"

MyLogfunction "got to the place that does Y"


I'd also put some error-handling in it and have the error-handler log any error it catches.

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Security perspectives to assess for APIs 1 44
google exe file 5 73
Allow non-admins ability to Restart Specified Servers via GPO 5 24
C qsort compare function issue 6 18
As cyber crime continues to grow in both numbers and sophistication, a troubling trend of optimization has emerged over the last year.
Ransomware continues to grow in reach and sophistication, putting data everywhere at risk. Learn how to avoid being caught in its sinister clutches with these 11 key tips.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question