locked
Why does .exe work manually but not via script ? (CLR20r3 event id) RRS feed

  • Question

  • Hi there,

    I've got a strange  error with .exe build with .Net Framework.

    A colleague (at the moment on holidays) write and build some .exe.

    When I launch them manually, it works perfectly but when I want to launch them via a script (I tried with PowerShell and Perl scripts) it doesn't work.

    I tried with the Schedule Tasks and it was the same result.

     

    I've got the following error (translated from French) :

    <Exe_Name> has stop working

    Error details :
    
    Event Type: CLR20r3
    
    P1: program.exe
    
    P2: 1.0.0.0
    
    P3: 4d8b6868
    
    P4: mscorlib
    
    P5: 2.0.0.0
    
    P6: 4bebe8e2
    
    P7: 349e
    
    P8: 1f7
    
    P9: System.UnauthorizedAccess
    
    System version : 6.1.7600.2.0.0.272.7

     

    Moreover, on the server Microsoft .NET Framework 4 Client Profile and Microsoft .NET Framework 4 Extended are setup.

    I read some articles about this error code but I don't find the solution because nobody had the same problem.

    Does the exe need to be launch with options or arguments ?

    Nobody know how to fix the problem ?

     

    Thanks in advance.

     

    Regards,

    Fabien Moreau

     

     



    Thursday, March 31, 2011 1:14 PM

Answers

  • I find the solution: instead using Invoke-Item I use the Invoke-Expression cmdlet.

    It works with :

     

    cd 'C:\Programs_Folder';
    Invoke-Expression 'C:\Programs_Folder\.\Program.exe';
    

     

     

    Thanks for your help :)


    • Marked as answer by Chuck Norris_ Friday, April 8, 2011 2:13 PM
    Friday, April 8, 2011 2:12 PM

All replies

  • Are you running this script (and exe) on another machine? I see the following:

    P9: System.UnauthorizedAccess

    Maybe your account can run your exe locally, but when you are running it on a server, you will need to define an account which your exe can use.


    Dimitri C. - Please mark the replies as answers if they help! Thanks.
    Thursday, March 31, 2011 1:33 PM
  • I work directly on the server. I execute scripts and exe with the same administrator account.

    I check permissions : everything is OK (everybody can execute .exe).

    Friday, April 1, 2011 12:58 PM
  • Maybe this will work:

    http://blogs.msdn.com/b/elton/archive/2006/03/06/545090.aspx 
    http://channel9.msdn.com/Forums/TechOff/258689-NET-20-Win-App-Eror-EventType-clr20r3 
    http://geekswithblogs.net/steveclements/archive/2008/04/30/error--eventtype-clr20r3.aspx 

    These are 3 similar problems and solutions. Maybe one of these works for you :). 

     


    Dimitri C. - Please mark the replies as answers if they help! Thanks.
    • Marked as answer by Paul Zhou Wednesday, April 6, 2011 10:35 AM
    • Unmarked as answer by Chuck Norris_ Friday, April 8, 2011 2:14 PM
    Friday, April 1, 2011 1:11 PM
  • Hi Chuck,

     

    Does Dimitri’s suggestion work on?

    If it doesn’t make sense, could you please provide code snippet of your script? Any information helps us to reproduce this issue is appreciated. Thanks.

    Any more concerns, please feel free to let us know.


    Paul Zhou [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Chuck Norris_ Monday, April 4, 2011 9:44 AM
    • Unmarked as answer by Chuck Norris_ Friday, April 8, 2011 2:13 PM
    Monday, April 4, 2011 3:22 AM
  • Hi Paul,

     

    I don't find issue in Dimitri's suggestion.

    I can't provide you the code snippet, I'm not the author and it'sconfidential...

    The author is right now editing his script because it's not the only problem I occured.

     

    Thanks for you support.

    I will update my status problem as soon as possible.

     

    Regards.

    Monday, April 4, 2011 9:43 AM
  • I find the solution: instead using Invoke-Item I use the Invoke-Expression cmdlet.

    It works with :

     

    cd 'C:\Programs_Folder';
    Invoke-Expression 'C:\Programs_Folder\.\Program.exe';
    

     

     

    Thanks for your help :)


    • Marked as answer by Chuck Norris_ Friday, April 8, 2011 2:13 PM
    Friday, April 8, 2011 2:12 PM