Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

Exécution d'un process

2 réponses
Avatar
Paraglider
Bonjour,

Si je provoque l'ex=E9cution d'un fichier exe, comment savoir si celui-
ci s'est correctement ex=E9cuter ??

Par exemple
' d=E9marrage du serveur \mysql\bin\mysqld.exe
procID =3D Shell(Application.StartupPath & "\mysql\bin\mysqld",
AppWinStyle.Hide)

Comment puis-je savoir si mysqld.exe a bien =E9t=E9 ex=E9cut=E9 ?

Merci de vos r=E9ponses.

Jacques

2 réponses

Avatar
Patrice
Bonjour,

Normalement un EXE retourne un code d'erreur après son exécution. Voir :
http://msdn.microsoft.com/fr-fr/library/system.diagnostics.process.exitcode.aspxet l'exemple (qui n'utilise donc pas l'instruction Shell propre à VB).--Patrice"Paraglider" a écrit dans le message denews:,Si je provoque l'exécution d'un fichier exe, comment savoir si celui-ci s'est correctement exécuter ??Par exemple' démarrage du serveur mysqlbinmysqld.exe procID = Shell(Application.StartupPath & "mysqlbinmysqld",AppWinStyle.Hide)Comment puis-je savoir si mysqld.exe a bien été exécuté ?Merci de vos réponses.Jacques
Avatar
LE TROLL
Bonjour,

Public Class Form1
Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MyBase.Load
Dim procID As Long
Try
procID = Shell("C:Windowssystem32calc.exe",
AppWinStyle.NormalFocus)
Catch
MsgBox("Erreur = " & procID & " : L'appel n'a pu se réaliser")
Finally
If procID <> 0 Then MsgBox("handle = " & procID)
End
End Try
End Sub
End Class

Cordialement ;o)
-
Logiciels, romans, contacts : http://irolog.free.fr
_______________________
.
.


"Paraglider" a écrit dans le message de
news:
Bonjour,

Si je provoque l'exécution d'un fichier exe, comment savoir si celui-
ci s'est correctement exécuter ??

Par exemple
' démarrage du serveur mysqlbinmysqld.exe
procID = Shell(Application.StartupPath & "mysqlbinmysqld",
AppWinStyle.Hide)

Comment puis-je savoir si mysqld.exe a bien été exécuté ?

Merci de vos réponses.

Jacques