Commande DOS ne fonctionne pas sous C# ????

Atoxis29 Messages postés 20 Date d'inscription mercredi 27 juillet 2011 Statut Membre Dernière intervention 19 avril 2012 - 8 mars 2012 à 12:30
Whismeril Messages postés 19028 Date d'inscription mardi 11 mars 2003 Statut Non membre Dernière intervention 24 avril 2024 - 8 mars 2012 à 13:49
Bonjour toutes et à tous,

J'ai un petit soucis que je trouve plutôt bizar.

J'effectue une commande dans ma console DOS Windows qui fonction très bien.

Mais lorsque je met celle-ci dans mon application elle ne fonctionne pas.

Qu'en pensez-vous ?

Voici ma commande inscrit sous DOS qui fonctionne:

C:>cd C:\[monrépertoire]\ & md5sum [monfichier].img > [monfichier].md5


Voici la commande exécuter sous C# :

createMD5.StartInfo.FileName = "cmd.exe";
            createMD5.StartInfo.Arguments = @"/C cd " + share + " & md5sum " + refAvion.Text + "-" + lblDT.Text + ".img > " + refAvion.Text + "-" + lblDT.Text + ".md5";
            createMD5.StartInfo.UseShellExecute = true;
            createMD5.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
            createMD5.Start();
            this.Invoke(new Action(value => this.progressBar1.Value = value), 92);
            createMD5.WaitForExit();
            createMD5.Close();


Avez-vous une solution ?

Merci d'avance,

Cordialement.

1 réponse

Whismeril Messages postés 19028 Date d'inscription mardi 11 mars 2003 Statut Non membre Dernière intervention 24 avril 2024 656
8 mars 2012 à 13:49
Bonjour

as tu essayé System.Diagnostics.Process.Start
Whismeril
0
Rejoignez-nous