Executing exe file in asp.net not working in server.

Last post 06-27-2008 1:44 AM by ramszone. 5 replies.

Sort Posts:

  • Executing exe file in asp.net not working in server.

    06-18-2008, 3:42 AM
    • Member
      2 point Member
    • ramszone
    • Member since 05-08-2008, 6:34 AM
    • Posts 6

    Hi Everyone

    I have developed a web application that runs an exe file for one event.

    It working fine in my local machine.

    When I host the application in the server(Windows server 2003 ), the exe file is not executing.

    I am using following code to run the exe file.

                Process batch = new Process();
                batch.StartInfo.FileName = SparseImageToolPath;
                batch.StartInfo.Arguments = args;
                batch.StartInfo.RedirectStandardInput = false;
                batch.StartInfo.RedirectStandardOutput = true;
                batch.StartInfo.CreateNoWindow = true;
                batch.StartInfo.UseShellExecute = false;
                batch.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
                batch.EnableRaisingEvents = true;
                batch.Exited += delegate(object sender, EventArgs e)
                {
                    if (BatchCompleted != null)
                        BatchCompleted(sender, e);
                };
                batch.Start();
                batch.WaitForExit();

    I have given full permissions to aspnet user.

    Can anybody please help me. 

    Thanks in advance.

    Rams. 


     

     

     

  • Re: Executing exe file in asp.net not working in server.

    06-18-2008, 4:33 AM
    • Participant
      1,278 point Participant
    • niharnayak2003
    • Member since 11-22-2007, 4:59 AM
    • Chennai
    • Posts 243

    When you are going to run the exe from IIS you need to provide the full permission in your webserver. then only it will run.

     

    Nihar ranjan Nayak
    Microsoft certified Professional
    niharnmayak2003@yahoo.co.uk
    www.webnihar.com
  • Re: Executing exe file in asp.net not working in server.

    06-18-2008, 6:20 AM
    • Member
      2 point Member
    • ramszone
    • Member since 05-08-2008, 6:34 AM
    • Posts 6

    Hi niharnayak,

    Thanks for reply.

    But I have already given full permissions to aspnet user.

    Is there any other settings I need to change? 

    Rams. 

  • Re: Executing exe file in asp.net not working in server.

    06-24-2008, 12:25 AM
    Answer

    ramszone:
    When I host the application in the server(Windows server 2003 ), the exe file is not executing.

    I have given full permissions to aspnet user.

     

    Hi Rams,

    Since your operating system on the server is Windows Server 2003, the default process identity of ASP.NET is “Network Service” instead of “ASPNET”. To solve this issue, you can change the identity of the corresponding application pool to “Local System”.

        1. Open IIS manager.
        2. Expand the “Application Pools” node.
        3. Right click the coresponding application pool, and then select “Properties”.
        4. Click the “Identity” tab, and select the “Local System” identity in the “Predefined” dropdown list.

    However, the above method can result in security risk because the process identity of ASP.NET is too powerful. You may consider impersonating an authenticating user in code, which only for starting process. You can find the code about how to implement it in the following link:

    How to implement impersonation in an ASP.NET application
    http://support.microsoft.com/kb/306158

    For your reference, you will know the reason why ASP.NET cannot start a process from the following article though it applies to ASP.NET 1.0.

    Unable to Start a Process from ASP.NET
    http://support.microsoft.com/kb/555134

    Sincerely,
    Benson Yu
    Microsoft Online Community Support

    Please remember to mark the replies as answers if they help and unmark them if they provide no help. This can be beneficial to other community members reading the thread.
  • Re: Executing exe file in asp.net not working in server.

    06-25-2008, 12:53 AM
    • Contributor
      2,158 point Contributor
    • vjay
    • Member since 06-18-2008, 1:53 PM
    • Posts 464

    hi,

    u havent given the full permission to explorer... but be carefull not to give full permisssion for security purposes..try to give only for read/write and not for modify....

  • Re: Executing exe file in asp.net not working in server.

    06-27-2008, 1:44 AM
    • Member
      2 point Member
    • ramszone
    • Member since 05-08-2008, 6:34 AM
    • Posts 6

     Hi Benson Yu,

    Thankyou verymuch  for your valuable reply.

    I will try it out.

    Thanks again.

    Rams. 

Page 1 of 1 (6 items)