vb script

i have a vb script that i am trying to move files from one directory to another.  i have a text file that contains the files i need to copy.  my problem is the extension are not listed in the text file. so i thought that i could concantenate the extensions with & "*.*" i get the error (object doesn't support this property).

Dim objShell, objFSO, objFile
Dim strCopyFrom, strfolderName, strCopyTo
Set objShell = CreateObject("Wscript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
strCopyFrom = "d:\\cadd\pdf manuals"
strCopyTo = "d:\\cadd\pdf manuals\ProductInspection"
'on error resume next

Set objFile = objFSO.OpenTextFile("d:\cadd\pdf manuals\manual.txt")
    objfile = objFile & "*.*"
Do While not objFile.AtEndOfStream
      strFolderName = objFile.Readline
      objFSO.copyFile strCopyFrom & "\" & strFolderName, strCopyTo & "\" & strFolderName
Loop
MNAdminAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

sirbountyCommented:
What if you simply remark that line out...?
Dim objShell, objFSO, objFile
Dim strCopyFrom, strfolderName, strCopyTo
Set objShell = CreateObject("Wscript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
 
strCopyFrom = "d:\\cadd\pdf manuals"
strCopyTo = "d:\\cadd\pdf manuals\ProductInspection"
'on error resume next
 
Set objFile = objFSO.OpenTextFile("d:\cadd\pdf manuals\manual.txt")
'    objfile = objFile & "*.*"
Do While not objFile.AtEndOfStream
      strFolderName = objFile.Readline
      objFSO.copyFile strCopyFrom & "\" & strFolderName, strCopyTo & "\" & strFolderName
Loop

Open in new window

0
MNAdminAuthor Commented:
then it gives me file not found
0
Shift-3Commented:
If I'm reading your question correctly, the file manual.txt contains the names of files (without extensions) which exist in the folder d:\cadd\pdf manuals.  If this is the case then the below should work.
 


Set objShell = CreateObject("Wscript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
strCopyFrom = "d:\cadd\pdf manuals"
strCopyTo = "d:\cadd\pdf manuals\ProductInspection"
'on error resume next
 
Set objFile = objFSO.OpenTextFile("d:\cadd\pdf manuals\manual.txt")
 
Do While not objFile.AtEndOfStream
    strFileName = objFile.Readline
    objFSO.CopyFile strCopyFrom & "\" & strFileName & ".*", strCopyTo
Loop
 
objFile.Close

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
MNAdminAuthor Commented:
Thank you Shift
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VB Script

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.