The following command works when entered in cmd :
"C:\Program Files\Scripts_Talend\SynchroExo_run.bat" --context_param FileCode=ABCD --context_param FilePath="//networkname/Folder/file.xls" --context_param ReportFilePath=""
But it doesn't work when I execute it with ProcessStartInfo :
ProcessStartInfo lTalendScriptInfo = new ProcessStartInfo("cmd.exe", "/c " + lCommand)
{
CreateNoWindow = true,
UseShellExecute = false,
RedirectStandardError = true,
RedirectStandardOutput = true
};
Process lTalendScriptProcess = Process.Start(lTalendScriptInfo);
lCommand being the same command string as shown just before. Quotes are correctly escaped thanks to \.
With ProcessStartInfo, the error is : 'C:\Program' is not recognized as an internal or external command, operable program or batch file As if the double quote was ignored and the part following the first space was as argument.
Are there any differences of interpretation between cmd and ProcessStartInfo ?