VBS - Afficher un fichier texte

tontonol Messages postés 44 Statut Membre -  
 tontonol -
Bonjour,

J'ai fait un script qui me retourne le résultat dans un fichier texte
Le nom de ce fichier texte est variabilisé (FichierSortie) à l'aide d'un inputbox . le fichier est généré à l'emplacement où le script est exécuté

Je cherche une méthode qui me permettrai de lancer l'affichage du fichier texte avec notepad2 ( à parir du sub main) une fois le script exécuté.

Merci pour vos orientations

--
Le doute est un hommage rendu à l'espoir.
Configuration: Windows 2000
Firefox 2.0.0.6

1 réponse

  1. tontonol
     
    J'ai trouvé tout seul, ne cherchez plus. Merci

    Sub afficheFichierSortie()
    Dim oFSO, oWshShell
    Set oFSO = CreateObject("Scripting.FileSystemObject")
    If oFSO.FileExists(FichierSortie) Then
    Set oWshShell = WScript.CreateObject("WScript.Shell")
    oWshShell.Run "notepad.exe " & FichierSortie, 1, False
    Set oWshShell = Nothing
    End If
    Set oFSO = Nothing
    End Sub
    0