I want to run ant.bat file in my C# application, but I am struggling of how to pass arguments there.
I have xmlFile
, mode
and date
which I want to pas as strings for the .bat file to work.
What I've tried:
void OpenWithArguments(string f)
{
Process.Start("ant.bat", file.xml);
}
Process process = new Process();
process.StartInfo.FileName = @"C:\aa\ant.bat";
process.StartInfo.Arguments = file.xml;
process.Start();
but how to pass several arguments for the .bat
file?
And by arguments I meant variables that I get from other methods, like:
string path = file.xml
`string date="2015-05-23" and so on. Can I also pass them the same way?