Thread: opening an exe

  1. #1
    Registered User
    Join Date
    Jan 2004

    Lightbulb opening an exe

    I have a web interface that is to send some information to a C++ exe file. Just for testing purposes, I have only create a main (in the prog) which creates a txt file. Once I click the button, nothing seems to happen (no file created). I even tried to do a Hello World, but Nada...can anyone help because I am totaly lost

    <script language="C#">
    using System.Diagnostics;
    void StartExecuting_Click (Object sender, EventArgs e) 
       string strfilePath="C:\\ABC\\Interface\\Code\\Debug\\test.exe";
       System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo(strfilePath);
       psi.UseShellExecute = true;
       System.Diagnostics.Process p = System.Diagnostics.Process.Start(psi);
    <input type="submit" value="submit" onServerClick="StartExecuting_Click"/>

  2. #2
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    ASP.NET runs on a different account and desktop to the interactive user. A process created on this desktop will not be visible to the interactive user.

    If the spawned process is a console application, an alternative may be to redirect its stdout and display it in the webpage.

    Something like(stolen from web):
    Process proc = new Process();
    proc.StartInfo.FileName = "uptime.exe";
    proc.StartInfo.Arguments = "-a";
    proc.StartInfo.UseShellExecute = false;
    proc.StartInfo.RedirectStandardOutput = true;
    StreamReader sw = proc.StandardOutput;
    string myString = sw.ReadToEnd();
    // Display myString in webpage

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. how to monitor exe and dll interactions?
    By George2 in forum C Programming
    Replies: 1
    Last Post: 10-26-2007, 04:22 AM
  2. how to run an exe command in c++ and get back the results?
    By mitilkhatoon in forum C++ Programming
    Replies: 5
    Last Post: 09-21-2006, 06:00 PM
  3. Close another exe from another exe??
    By Tony in forum Windows Programming
    Replies: 1
    Last Post: 06-12-2002, 07:19 AM
  4. insert another exe into exe
    By lliero in forum C Programming
    Replies: 8
    Last Post: 04-12-2002, 12:22 PM
  5. adding bytes to EXE to call another EXE
    By lliero in forum C Programming
    Replies: 2
    Last Post: 03-30-2002, 07:23 AM