[Mono-winforms-list] Run One Exe from another exe

Jackson Harper jackson@ximian.com
Thu, 27 Jan 2005 01:10:31 -0800


On Thu, 2005-01-27 at 19:39 +0530, Umashankar Ashwathnarayanan wrote:
> Hi
> I am running one simple Program that call another exe
> 
> Code :
> 
>    System.Diagnostics.Process proc = new System.Diagnostics.Process();
>                proc.EnableRaisingEvents=false;
>                proc.StartInfo.FileName="WindowTest";
>                proc.StartInfo.Arguments="WindowTest.exe";
>                proc.Start();                proc.WaitForExit();
> 
> This is call when i press the button.
> The WindowTest.exe is present in bin folder of the application,
> When i Press the button ,
> it call that Speficied file/path  is not present

  Try printing out System.IO.Directory.GetCurrentDirectory (). Thats the
directory that is being looked in for the exe. What you probably need to
do is build your path based on the executing assemblies path. Use:
System.Reflection.Assembly.GetExecutingAssembly ().CodeBase to get the
executing assemblies path. Then from there you can create the proper
path to pass to the StartInfo.

Cheers,
Jackson


> Can any body help me.
> 
> Kumar
> _______________________________________________
> Mono-winforms-list maillist  -  Mono-winforms-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-winforms-list