1 2 3 4 5 6 7 8 9 10
| static public SystemProcess Start(string filename, string args, string workpath, bool child)
{
var process = new SystemProcess();
process.StartInfo.FileName = filename;
process.StartInfo.WorkingDirectory = workpath;
process.StartInfo.Arguments = args;
process.StartInfo.UseShellExecute = child;
process.Start();
return process;
} |
avec ce bug, il faut à priori ajouter les " et " de début et de fin dans la chaine du filename comme des arguments car sinon la ligne de commande va considérer les espaces comme des séparateurs d'items de liste de chaines :
Start("\"c:\\the path\\the file.exe\"", "", "", false);
Partager