"Access Denied" using public static Process Start(string, string);

Discussion in 'ASP .Net Security' started by EJS, Sep 17, 2003.

  1. EJS

    EJS Guest

    We are using Network Associates VirusScan to check files uploaded from a web
    page for viruses.
    The code below worked fine using .Net 1.1 on Win2000. The ASP.Net user
    account was given permissions to run the EXE and access to the files being
    scanned.

    When we migrated to Win2003 we ran into problems. ASP.Net now runs under the
    Network Services account. So we gave this account the same privilages but
    the code throws an System.ComponentModel.Win32Exception "Access is Denied"

    If we add the Network Services account to the "Administrators" group the
    code executes WITHOUT error.

    Any help would be greatly appreciated
    Thanks in advance.
    Ed

    CODE:
    //Run Virus Scan
    oCmd = Process.Start(sScanExe, sFilePath); <---- ERROR

    //Wait for iScanTimeOut mSec
    //If OS exited the procees true is returned if timed out false is returned
    bNormalExit = oCmd.WaitForExit(iScanTimeOut);
    iErrorCode = oCmd.ExitCode;
    oCmd.Close();

    Error Log:
    ; Source: System
    ; Description: Access is denied
    ; Stack: at
    System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo
    startInfo)
    at System.Diagnostics.Process.Start()
    at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
    at System.Diagnostics.Process.Start(String fileName, String arguments)
     
    EJS, Sep 17, 2003
    #1
    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. Charles A. Lackman
    Replies:
    1
    Views:
    1,381
    smith
    Dec 8, 2004
  2. SpamProof
    Replies:
    0
    Views:
    590
    SpamProof
    Oct 21, 2003
  3. Cédric Rossé
    Replies:
    3
    Views:
    22,711
    Anmol_Kumar
    Sep 23, 2008
  4. Steve Mauldin
    Replies:
    5
    Views:
    1,724
    Steve Mauldin
    Jan 26, 2006
  5. Chip Gore
    Replies:
    6
    Views:
    2,208
    Ben Voigt [C++ MVP]
    Apr 10, 2008
Loading...

Share This Page