Solved

Running a Console VB app as a schedule task

Posted on 2008-10-21
9
818 Views
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
0
Comment
Question by:thomashospital
  • 4
  • 3
9 Comments
 
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"
0
 

Author Comment

by:thomashospital
ID: 22769583
Daniel,

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!!!!
0
 
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
0
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 

Author Comment

by:thomashospital
ID: 22776524
The log only shows the task complete with an exit code of (e0434f4d)
0
 
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.
0
 

Author Comment

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

Accepted Solution

by:
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"

etc.


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

Featured Post

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.

Question has a verified solution.

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

Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
One of the biggest threats facing all high-value targets are APT's.  These threats include sophisticated tactics that "often starts with mapping human organization and collecting intelligence on employees, who are nowadays a weaker link than network…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

803 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