Running a Console VB app as a schedule task

Posted on 2008-10-21
Medium Priority
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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Ransomware Attacks Keeping You Up at Night?

Will your organization be ransomware's next victim?  The good news is that these attacks are predicable and therefore preventable. Learn more about how you can  stop a ransomware attacks before encryption takes place with our Ransomware Prevention Kit!


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 1000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

With the rising number of cyber attacks in recent years, keeping your personal data safe has become more important than ever. The tips outlined in this article will help you keep your identitfy safe.
Let's recap what we learned from yesterday's Skyport Systems webinar.
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…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

765 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