Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Visual Basic ( VB ) (http://www.go4expert.com/forums/visual-basic/)
-   -   Copy files from a text file from given a parameters in a .ini using VBScript (http://www.go4expert.com/forums/copy-files-text-file-parameters-ini-t28179/)

AutosysR11 12Apr2012 20:50

Copy files from a text file from given a parameters in a .ini using VBScript
 
I was trying to resolve my issue in listing a files from a text file to another folder. The script open a file named ".ini" which contain a parameters. The script will use the parameters to copy all files from the list file.
Code:

Dim export_file, item, path, extension

Set objFSO = CreateObject("Scripting.FileSystemObject")

Set objPath = objFSO.GetFolder(path)

Set objNewFile = objFSO.CreateTextFile(export_file, True)

sExtension = objFso.GetExtensionName(extension)

Set colFiles = objPath.Files
              For Each Item in colFiles
              If objFSO.GetExtensionName(Item.Name) = sExtension Then
              objNewFile.WriteLine Item.Name
              End If
        Next

objNewFile.Close



All times are GMT +5.5. The time now is 02:17.