shell Quastion : How to run console exe with C# with Arguments?

S

Saleh Matani

Hello ,
i have an exe programme that i need to call from C# Programm that i
wrote but with Arguments.
for example

compress.exe "MyFolder" "zipPassword"


P.s. i know that the System.Diagnostics.Process mybe doing that but i
have tried and it did not work , help for me will be an example !

Thank you

Saleh Matani
 
S

Scott Coonce

Look at one of the overloads of the Process.Start. One of them takes a
string array of arguements. I think it's something like
Process.Start("compress.exe", new string[]{MyFolder, zipPassword}); though I
haven't tested this.

Scott
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

Did you check the properties and methods of Process ?

You have a couple of options:
1- Process.Start( commandName, commandArguments )
2- If you are using ProcessStartInfo
Set ProcessSTartInfo.Arguments


cheers,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top