Link to home
Start Free TrialLog in
Avatar of paulsidebottom
paulsidebottom

asked on

Launching Process

Hi,

I would like to launch a process from within my application, at present I am using the System.Diagnostics.Process class to launch the process. In addition, I am passing in any command line arguments using the second parameter of the start method, e.g. :

   System.Diagnostics.Process.Start(oTask.Command, oTask.Arguments);

This works fine for most things. However it doesnt seem to work when the target is specified in the same format as the target field within a Windows Shortcut, for example if the target path of the shortcut is:

Comms.exe WaitForExit=0

I pass this as:

      System.Diagnostics.Process.Start("Comms.exe","WaitForExit=0");

Any ideas?

Thanks

ASKER CERTIFIED SOLUTION
Avatar of Fahad Mukhtar
Fahad Mukhtar
Flag of Pakistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of seazium
seazium

chk it out .., it will describe u better
http://www.codeproject.com/csharp/HowToLaunchProcess.asp

dZ..,
another 1 .., little bit more brief

http://www.codeproject.com/csharp/LaunchProcess.asp

dZ..,
Avatar of paulsidebottom

ASKER

Thanks for the replies but as stated, I am already using the arguments property to pass command arguments.  It seems the problem may not originate from the use the of command arguments more the process equivalent of Windows "start in" property.

Does anyone know how the start in property can be specified for a process?

Thanks.
SOLUTION
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Apologies, I forgot I posted this - yes I'm happy with the resolution. Thanks for your answers.