Program will not run as scheduled event

I have a program that parses several files and writes them to an MS SQL database. I have insert debug statements everywhere at  this point to try to determine the problem, but with no luck. When I run the program on the server, it runs perfectly. I then schedule the program to run using windows scheduler and it fails everytime. It is currently located in the c:\Winnt\ directory, and it is an .exe program. the error I receive is as follows, I woiuld appreciate any help.:



The description for Event ID ( 0 ) in Source ( .NET Runtime ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. The following information is part of the event: .NET Runtime version 1.1.4322.2032- ParseInventory.exe - Common Language Runtime Debugging Services: Application has generated an exception that could not be handled.

Process id=0x1394 (5012), Thread id=0x1348 (4936).

Click OK to terminate the application.
Click CANCEL to debug the application..
CJSantoraAsked:
Who is Participating?
 
ajitanandCommented:
1. Open Task Scheduler
2. Right Click the Task -> Properties -> Key in the information: Run As + Set Password - to the user that has enuff rights required by the application, i.e. the local admin account is one such choice.

hope this helps,
Ajit Anand
0
 
ryerrasCommented:
This article should help you out. Pay attention to DCOM settings configurations

http://support.microsoft.com/default.aspx?scid=kb;en-us;833977&Product=vsnet#3a
0
 
CJSantoraAuthor Commented:
Here is some additional debugging if it helps anyone with this problem:

An unhandled exception of type 'System.Security.SecurityException' occurred in mscorlib.dll

Additional information: Request for the permission of type System.Security.Permissions.FileIOPermission, mscorlib, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
ryerrasCommented:
Hmm. It is certainly some permissions issue. Configure the permission according to your situation


(1) Open "Control Panel".
(2) Open the "Administrative Tools" folder.
(3) Double-click "Microsoft .NET Framework Configuration".
(4) There you must change the "Runtime Security Policy" if you want to

0
 
rdrunnerCommented:
When you scedule a task to run it will be executed as the local system account

This means you wont be able to access network shares or use integrated security to connect o the DB...

Hope this helps
0
 
rdrunnerCommented:
P.s.:

Of course you can also configure who is executing the task... But this depends on the OS you use..
0
 
CJSantoraAuthor Commented:
This is definitely a problem, the script needs to access network shares, is there a solution to this.
0
 
rdrunnerCommented:
Yes

You can define under which account the task gets started. Reightclick on the task under XP and goto its properties. There should be a user account. If you dont use XP i think you need to change the account which the tasksceduler is running.

Also use UNC names and not mapped drive letters when you try to access the files
0
 
CJSantoraAuthor Commented:
Thank you for your sggestion, that seems to have resolve dthe problem.
CJSantora
0
 
rdrunnerCommented:
What was wrong with my answers?

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.