Page 1 of 1

Setting the woring directory for an Application

Posted: Mon Mar 03, 2008 1:19 pm
by fdv
Hi,

I am evaluating Ranorex and I would like to know how can I set the working directory for an Application before it starts, like this:

System.Disgnostics.Process pr = new Process();
pr.StartInfo.WorkingDirectory = path;
pr.StartInfo.Arguments = args;
pr.StartInfo.FileName = exe;
pr.Start();
pr.WaitForInputIdle();

I would like to do something like this but with the Application class and if it is not possible, how can I use the Process class with Ranorex.

Thanks

Posted: Mon Mar 03, 2008 4:34 pm
by fdv
OK, I got it. I did not understand how does the Application class work. Now, everything is clear to me.

Thanks

Posted: Mon Mar 03, 2008 5:19 pm
by Support Team
Let me just add my two cents:
The preferred way in Ranorex.Net to start an application is to use the System.Diagnostics.Process class as it is much more flexible than the Ranorex.Application.Start method.

The Ranorex.Application.Start is provided for backwards compatibility only and will be marked Obsolete from Ranorex version 1.4 on.

Regards,
Alex
Ranorex Support Team