I'm trying to make my script read a text file which has numbers on each row, then it should compare the text file with some file names that are in a folder, finally its copies the file names it compare with the text file to a another folder.
I'm still learning how to script, so I hope someone out there can help.


Const ForReading = 1
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile _
    ("c:\mytest1\test.txt", ForReading)
Do Until objTextFile.AtEndOfStream
    strNextLine = objTextFile.Readline
    arrServiceList = Split(strNextLine , ",")
    Wscript.Echo "Server name: " & arrServiceList(0)
    For i = 1 to Ubound(arrServiceList)
        Wscript.Echo "Service: " & arrServiceList(i)
    Set objFSO = CreateObject("Scripting.FileSystemObject")

If arrServiceList("C:\test1\*.pdf") Then
    objFSO.CopyFile "C:\test1\*.pdf,  "C:\test2\"
    Wscript.Echo "The file does not exist."
End If

Last edited by shabbir; 18Oct2011 at 11:55.. Reason: Code blocks