Weird Diagnostics.Process bug

Discussion in 'ASP .Net' started by Bill Rapoza, Aug 29, 2005.

  1. Bill Rapoza

    Bill Rapoza Guest

    We have a method that executes an arbitrary batch file (we use it for remote
    upgrades of our system).

    When we execute this method from outside of ASP.NET (either in the
    foreground app or from a windows service), the method works fine. However,
    when we execute it from ASP.NET, the execution fails on some machines. Now,
    if instead of running the batch file directly, I run cmd.exe and have it run
    the batch file:

    cmd /k platformupgrade.bat

    the batch file still does not execute (note: I'm using /k instead of /c for
    debugging purposes. the behavior is identical).

    However, if I run cmd and have it also run cmd and have the second cmd run
    the batch file:

    cmd /k cmd /c platformupgrade.bat

    The batch file runs fine.

    What's going on here? Frankly, I'm very leery of including this "fix" into
    my application because it's so strange.
    Bill Rapoza, Aug 29, 2005
    #1
    1. Advertising

  2. Hi Bill,

    Welcome to ASP.NET newsgroup.
    Regarding on this executing bat file under asp.net app fail problem, based
    on my experience, it seems likely something related to the asp.net's
    workerprocess account which is a very restricted account.

    As for the the failure on some machine, did it means the bat file even not
    get executed or executed and fail in the middle or at certain point? If it
    fails at certain point, I'd suggest we try simplify the bat file to get
    what operation make the broken.
    In addition, have you found any eventlog entry on that machine related to
    this problem? Also, for the current workaround you mentioned, I'm also
    feeling a bit strange, but I think we may need to perform some general test
    first so as to make thing clearer.

    Looking forward to your response. Thanks,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)




    --------------------
    | From: "Bill Rapoza" <>
    | Subject: Weird Diagnostics.Process bug
    | Date: Mon, 29 Aug 2005 10:21:03 -0700
    | Lines: 25
    | X-Priority: 3
    | X-MSMail-Priority: Normal
    | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
    | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
    | X-RFC2646: Format=Flowed; Original
    | Message-ID: <>
    | Newsgroups: microsoft.public.dotnet.framework.aspnet
    | NNTP-Posting-Host: 199.244.171.156
    | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
    | Xref: TK2MSFTNGXA01.phx.gbl
    microsoft.public.dotnet.framework.aspnet:120967
    | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    |
    | We have a method that executes an arbitrary batch file (we use it for
    remote
    | upgrades of our system).
    |
    | When we execute this method from outside of ASP.NET (either in the
    | foreground app or from a windows service), the method works fine.
    However,
    | when we execute it from ASP.NET, the execution fails on some machines.
    Now,
    | if instead of running the batch file directly, I run cmd.exe and have it
    run
    | the batch file:
    |
    | cmd /k platformupgrade.bat
    |
    | the batch file still does not execute (note: I'm using /k instead of /c
    for
    | debugging purposes. the behavior is identical).
    |
    | However, if I run cmd and have it also run cmd and have the second cmd
    run
    | the batch file:
    |
    | cmd /k cmd /c platformupgrade.bat
    |
    | The batch file runs fine.
    |
    | What's going on here? Frankly, I'm very leery of including this "fix"
    into
    | my application because it's so strange.
    |
    |
    |
    Steven Cheng[MSFT], Aug 30, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Simple Simon
    Replies:
    0
    Views:
    366
    Simple Simon
    Dec 15, 2003
  2. Ron Fidel
    Replies:
    4
    Views:
    4,119
    Ronen Fidel
    Jan 15, 2004
  3. Michael Johnson Sr.

    System.Diagnostics, Process and Security

    Michael Johnson Sr., Feb 13, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    2,839
    Michael Johnson Sr.
    Feb 13, 2004
  4. Heiko Besemann
    Replies:
    1
    Views:
    2,864
    Harsh Thakur
    Feb 19, 2004
  5. Steve Bishop

    System.Diagnostics.Process Question

    Steve Bishop, Feb 27, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    2,389
    Eric Lawrence [MSFT]
    Mar 1, 2004
Loading...

Share This Page