0

I read other answers to this, but cannot work mine. maybe because of the difference. The difference is that my hex file are on an external device and here is the hierarchy

/home/root/myfolder/General

and the EXE that I want to execute

/TestLiberatus_Stress.exe

so here is what I have up to now

string ex1 = "/home/root/myfolder/Functional/TestLiberatus_Stress.exe";

// Use ProcessStartInfo class
ProcessStartInfo startInfo = new ProcessStartInfo();

startInfo.CreateNoWindow = false;
startInfo.UseShellExecute = false;
startInfo.FileName = ex1;
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
startInfo.Arguments = "";

try
{
    // Start the process with the info we specified.
    // Call WaitForExit and then the using statement will close.
    using (Process exeProcess = Process.Start(startInfo))
    {
        exeProcess.WaitForExit();
    }
}
catch
{
    int x = 0; //just to know it enters for now
}

From the other explanations that I've found, it should work... So, where is the problem?
Also once this work, what I'd like to do intead of giving the full path would be to just go up one level and go in stress. The executing EXE will be in the path I've given, the full path, and the other one to execute will be in

/home/root/myfolder/Functional
shA.t
  • 16,580
  • 5
  • 54
  • 111
Cher
  • 2,789
  • 10
  • 37
  • 64
  • On what drive is `/home/` located on? – EyeSeeSharp May 12 '15 at 16:24
  • backslashes instead of slashes? Is this windows or Mono? – DrKoch May 12 '15 at 16:27
  • Do you get errors? Make that catch catch an Exception so that you can get some information if an one is being thrown. `catch (Exception ex)`. – DWright May 12 '15 at 16:27
  • string ex1 = `"../Functional/TestLiberatus_Stress.exe"` – James May 12 '15 at 16:30
  • not sure aboout the drive for home, when I look the path it's direct (I'm working with a graphic card to help someone, I'm booting on the card – Cher May 12 '15 at 17:11
  • it's in Mono the error says it cannot find it – Cher May 12 '15 at 17:11
  • 2
    “it cannot find it” is meaningless. Your `catch` clause is hiding the error from you; remove that clause, copy the error message, and [edit](http://stackoverflow.com/posts/30196158/edit) your question to include the message. – Dour High Arch May 12 '15 at 17:24

0 Answers0