Hello all,
I'm hoping someone can help me out and save my hair....
What I am trying to do, is copy a list of jpgs contained in a txt file from folder A to Folder B, so that I can burn them to a cd.
This script worked ok with a move ... not sure what I did, or didn't do, to get it to quit working.
any ideas?
thnx
I'm hoping someone can help me out and save my hair....
What I am trying to do, is copy a list of jpgs contained in a txt file from folder A to Folder B, so that I can burn them to a cd.
This script worked ok with a move ... not sure what I did, or didn't do, to get it to quit working.
Code:
Const ForReading = 1
strComputer = "."
set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("c:\scripts\copy.txt", ForReading)
Do Until objFile.AtEndOfStream
strLine = objFile.ReadLine
arrParts = Split(strLine, ",")
strFile = "C:\\scripts\\" & arrParts(0)
Set colItems = objWMIService.ExecQuery _
("Select * From CIM_Datafile Where Name = '" & strFile & "'")
For Each objItem in colItems
strNewName = "C:\\scripts2\" & arrParts(1)
object.CopyFile strNewName
Next
Loop
objFile.Close
any ideas?
thnx