Comment executer un programme a partir d'un dossier choisi préalablement

HTMLer Messages postés 24 Date d'inscription vendredi 19 mai 2006 Statut Membre Dernière intervention 3 août 2009 - 11 nov. 2008 à 17:40
Renfield Messages postés 17287 Date d'inscription mercredi 2 janvier 2002 Statut Modérateur Dernière intervention 27 septembre 2021 - 12 nov. 2008 à 06:00
Bonjour à tous,
Comment executer un programme a partir d'un dossier choisi préalablement ?
Public Sub DemarrerApplication(ByVal NomApplication$, Optional ByVal ParametresApplication$ = "")
        Try
            Dim Processus As New System.Diagnostics.Process()
            If NomApplication <> String.Empty And ParametresApplication <> String.Empty Then
                With Processus
                    .StartInfo.FileName = NomApplication
                    .StartInfo.Arguments = ParametresApplication
                    .Start()
                End With
            Else
                With Processus
                    .StartInfo.FileName = NomApplication
                    .Start()
                End With
            End If
        Catch ex As Exception
            MsgBox("[" & My.Computer.Clock.GmtTime.ToString & "]> Erreur lors du démarrage de l'application: " & ex.Message & vbCrLf)
        End Try
    End Sub
Ca c'est une fonction que j'avais trouver sur VBFR mais lorsque j'execute cette fonction par exemple :

DemarrerApplication("D:\Program Files\Activision\Call of Duty 4 - Modern Warfare\iw3mp.exe", "AGUMENTS")
La le programme lancait Call Of Duty 4 à partir de où était mon EXE

Merci de vos réponses

Jonathan

1 réponse

Renfield Messages postés 17287 Date d'inscription mercredi 2 janvier 2002 Statut Modérateur Dernière intervention 27 septembre 2021 74
12 nov. 2008 à 06:00
0
Rejoignez-nous