Comment executer un programme a partir d'un dossier choisi préalablement
HTMLer
Messages postés24Date d'inscriptionvendredi 19 mai 2006StatutMembreDernière intervention 3 août 2009
-
11 nov. 2008 à 17:40
Renfield
Messages postés17287Date d'inscriptionmercredi 2 janvier 2002StatutModérateurDernière intervention27 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
A voir également:
Comment executer un programme a partir d'un dossier choisi préalablement