Code:
Dim objFSO
Dim MyFile
Dim MyFolder
Dim objShell
Dim Prefix

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set MyFolder = objFSO.GetFolder("c:\horses\form")
Set objShell = WScript.CreateObject("WScript.Shell")

Prefix = InputBox("(*) Enter prefix for file-names (e.g. for opening 0310*.html or 0310*.htm files, enter 0310) :"+vbcrlf+vbcrlf+"(*) Leaving this blank or, clicking cancel will open *.html or *.htm files ...", "File-Name Prefix")
For Each MyFile In MyFolder.Files
    If (Right(MyFile.Path,4) = ".htm" Or Right(MyFile.Path,5) = ".html") And Left(MyFile.Name,Len(Prefix)) = Prefix Then
        objShell.Run("notepad " + MyFile.Path)
    End If
Next
can you see anything wrong.

Last edited by shabbir; 27Apr2010 at 16:31.. Reason: Code blocks