Dim objFSO
Dim MyFile
Dim MyFolder
Dim objShell
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set MyFolder = objFSO.GetFolder("C:\Test")
Set objShell = WScript.CreateObject("WScript.Shell")
For Each MyFile In MyFolder.Files
If Right(MyFile.Path,4) = ".txt" Then
objShell.Run("notepad " + MyFile.Path)
End If
Next
Dim MyFile
Dim MyFolder
Dim objShell
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set MyFolder = objFSO.GetFolder("C:\Test")
Set objShell = WScript.CreateObject("WScript.Shell")
For Each MyFile In MyFolder.Files
If Right(MyFile.Path,4) = ".txt" Then
objShell.Run("notepad " + MyFile.Path)
End If
Next


