Executable de lancement

Amandine -  
Canard007 Messages postés 5936 Statut Contributeur -
Bonjour,

J'aimerai créer un executable en vb qui me permette de lancer automatiquement des fichiers.un peu comme si j'utilisais les taches planifieés...
Je ne connais pas les commandes et je ne trouve pas sur le net...
merci.
Amandine.

4 réponses

Canard007 Messages postés 5936 Statut Contributeur 215
 
jai trouvé ca sur le net:
Private Sub Command1_Click()
'Ouvre Fichier.exe
Shell App.Path & "/Fichier.exe"
End Sub


si tu veux sinon je sais comment le faire en VBS si sa t'interresse?
0
Amandine
 
merci je vais essayer.
:-)
0
Amandine
 
non snif ca marche pas
0
Canard007 Messages postés 5936 Statut Contributeur 215
 
ya ca mais c est du VB.NET donc je sais pas si c est compatible..

Public Sub ShellandWait(ByVal ProcessPath As String)
        Dim objProcess As System.Diagnostics.Process
        Try
            objProcess = New System.Diagnostics.Process()
            objProcess.StartInfo.FileName = ProcessPath
            objProcess.StartInfo.WindowStyle = ProcessWindowStyle.Normal
            objProcess.Start()

            'Wait until the process passes back an exit code 
            objProcess.WaitForExit()

            'Free resources associated with this process
            objProcess.Close()
        Catch
            MessageBox.Show("Could not start process " & ProcessPath, "Error")
        End Try
    End Sub


La dictature c'est : "ferme ta geule !"
La democratie c'est : "cause toujours !"
0