Bonjour à toutes et à tous,
Avec mon Fichier .vbs j'aimerai avec une boite de dialog pouvoir choisir mon dossier et mon fichier plutôt que de les fixer par défaut.
J'ai ce code mais malgré mes essais d'adaptation je n'y arrive pas.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14 ' Définir le chemin du dossier et le nom du fichier Dim dossierParent, nomFichier dossierParent = "C:\Test\" nomFichier = "Test1.jpg" ' Créer l'objet Shell Set objShell = CreateObject("Shell.Application") Set objFolder = objShell.Namespace(dossierParent) Set objFile = objFolder.ParseName(nomFichier) WScript.Echo "Fichier : " & objFolder.GetDetailsOf(objFile, 0) WScript.Echo "Date prise : " & objFolder.GetDetailsOf(objFile, 161) WScript.Echo "Appareil : " & objFolder.GetDetailsOf(objFile, 175)
@+,
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 Dim objShell, objFolder, strFileName Set objShell = CreateObject("Shell.Application") ' Ouvre la boîte de dialogue de sélection de fichier Set objFolder = objShell.BrowseForFolder(0, "Sélectionnez un fichier :", &H4000) If Not objFolder Is Nothing Then strFileName = objFolder.Self.Path MsgBox "Vous avez sélectionné : " & strFileName Else MsgBox "Aucun fichier sélectionné." End If Set objFolder = Nothing Set objShell = Nothing
cincap






Répondre avec citation



Partager