Woap
Messages postés4Date d'inscriptionsamedi 6 juin 2015StatutMembreDernière intervention 8 juin 2015
-
Modifié par Whismeril le 6/06/2015 à 10:11
Woap
Messages postés4Date d'inscriptionsamedi 6 juin 2015StatutMembreDernière intervention 8 juin 2015
-
8 juin 2015 à 10:43
Bonjour,
Dans mon programme je dois pouvoir lancer un bat ( pour l'installation d'un logiciel ) si on coche le checkbox.
Le problème c'est que j'ai plusieurs checkbox et je dois donc lancer plusieurs bat l'un après l'autre.
Donc il faut que j'attende que le premier processus se fini avant de lancer le deuxième et je cherche donc une méthode pour faire cela
Petit exemple de mon code actuel :
If Vlc.Checked Then
Dim Alzip = Shell("D:\allo\Bat\VLC.bat")
System.Threading.Thread.Sleep(45000)
End If
If Picasa.Checked Then
Dim Alzip = Shell("D:\allo\Bat\picasa.bat")
System.Threading.Thread.Sleep(45000)
End If
J'avais fait de cette manière avec 45 sec d'attente entre les deux, sur certain pc ça va plus vite d'autre trop lentement donc il me faudrait une autre méthode.
J'ai fait quelque recherche j'ai trouvé quelque chose comme ça :
Dim ProcessProperties As New ProcessStartInfo
ProcessProperties.FileName = "picasa"
ProcessProperties.Arguments = "D:\allo\Bat\picasa.bat"
ProcessProperties.WindowStyle = ProcessWindowStyle.Maximized
Dim myProcess As Process = Process.Start(ProcessProperties) <--
myProcess.WaitForExit()
le : Process.Start(ProcessProperties), visual ne me l'accepte pas
"Argument not specified for parameter 'p1' of 'Private Sub Process(p1 As Object)"
Pourriez-vous m'aider ?
Merci !
EDIT: Correction du langage dans la coloration syntaxique, si tu lui dit que c'est du C# et que tu écris en VB, ça ne marche pas.
Woap
Messages postés4Date d'inscriptionsamedi 6 juin 2015StatutMembreDernière intervention 8 juin 2015 8 juin 2015 à 10:23
Do
If CBool(Process.GetProcesses.Where(Function(P As Process) P.ProcessName = "notepad").Count) Then
Exit Do
End If
Threading.Thread.Sleep(100)
Loop
J'ai trouvé une nouvelle méthode mais sa me dit sa
Error 1 Argument not specified for parameter 'p1' of 'Private Sub Process(p1 As Object)'. C:\Users\Utilisateur\Desktop\WindowsApplication1\Form1.vb 219 22 WindowsApplication1
8 juin 2015 à 09:39