How to launch an app with Arguments

434 views
Skip to first unread message

vijay acharya

unread,
Oct 8, 2013, 11:59:03 AM10/8/13
to teststa...@googlegroups.com
hi
 
My launch string has several parameters along with name of the exe. For e.g "C:\Program Files\abcd\acad.exe"  /p AutoTesting /nologo /ld "D:\TargetFolder\Bin\pidacad.arx"
 
I have tried to  launch using processtartinfo, stringbuilder and other options but unable to launch it.
 
Any suggestions.
 
Thanks
Vijay

 

Jake Ginnivan

unread,
Oct 8, 2013, 12:02:26 PM10/8/13
to vijay acharya, teststa...@googlegroups.com

Launch the process using Process.Start() and the various overloads. Then you can use Application.Attach() instead of Launch in White once you successfully launch the application.

 

Maybe use Linqpad to test the various different overloads to see what works for you.

 

Cheers,

Jake

--
You received this message because you are subscribed to the Google Groups "TestStack.White" group.
To unsubscribe from this group and stop receiving emails from it, send an email to teststack_whi...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

vijay acharya

unread,
Oct 9, 2013, 9:06:37 AM10/9/13
to teststa...@googlegroups.com

vijay acharya

unread,
Oct 9, 2013, 9:07:07 AM10/9/13
to teststa...@googlegroups.com
I tired with Process.start() and ProcessInfo but had no luck. I also tried using a shortcut to it. See code below:

Process

Proc = new Process();

Proc.StartInfo.FileName =

@"C:\Test.lnk";

Proc.Start();

' using ProcessStartInfo

ProcessStartInfo info = new ProcessStartInfo(@"C:\Test.lnk");

info.CreateNoWindow = true;

info.UseShellExecute = false;

info.RedirectStandardError = true;

info.RedirectStandardOutput = true;

info.RedirectStandardInput = true;

Process whatever = Process.Start(info)

 

The error I keep getting is its an invalid file but its a legit file and can be opened manually

 

I was thinking of using Desktop object to invoke it by double clicking on it.  is this possible to do in White. I have had look at desktop class but couldn't find any examples to get on with it.
 
Thanks

On Tuesday, October 8, 2013 4:59:03 PM UTC+1, vijay acharya wrote:
Reply all
Reply to author
Forward
0 new messages