Solved

Program will not run as scheduled event

Posted on 2004-10-29
343 Views
Last Modified: 2008-02-26
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..
0
Question by:CJSantora
    10 Comments
     
    LVL 6

    Expert Comment

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

    Author Comment

    by:CJSantora
    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
     
    LVL 6

    Expert Comment

    by:ryerras
    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
     
    LVL 11

    Expert Comment

    by:rdrunner
    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
     
    LVL 11

    Expert Comment

    by:rdrunner
    P.s.:

    Of course you can also configure who is executing the task... But this depends on the OS you use..
    0
     

    Author Comment

    by:CJSantora
    This is definitely a problem, the script needs to access network shares, is there a solution to this.
    0
     
    LVL 11

    Expert Comment

    by:rdrunner
    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
     
    LVL 5

    Accepted Solution

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

    Author Comment

    by:CJSantora
    Thank you for your sggestion, that seems to have resolve dthe problem.
    CJSantora
    0
     
    LVL 11

    Expert Comment

    by:rdrunner
    What was wrong with my answers?

    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone. Privacy Policy Terms of Use

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
    This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    877 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

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now