I'm looking to copy folders from one drive to another but I want the script
to look inside a .txt file and only move the folders that are named in the
text file. I know how to move one folder at a time with a script but I
don't know how to get the script to look inside a .txt file to do it. Can
anyone help.

Thanks,
KB

Re: script copying folders by Rafael

Rafael
Mon Jun 20 20:19:38 CDT 2005

KB,

since you already know how to copy, here is a piece of code on how to pen
the text file and read it.


dim fileName
fileName=inputbox("Type path and file name","Enter info")

set objFS=CreateObject ("Scripting.FileSystemObject")
set listFile = objFS.OpenTextFile (fileName)
do while listFile.AtEndOfStream <> True
Wscript.Echo listFile.ReadLine
Loop

*******
that's all you need. Change the fileName to the path and file name hardcode
instead of asking the user.
Remember listFile.ReadLIne is reading the text file line by line, so you
will probably need to insert all file names into an array before start
copying or copy each file as soon as the name is read.

hope this helps,
RT
"KB" <corporatejr@hotmail.com> wrote in message
news:eNcTbVcdFHA.3712@TK2MSFTNGP09.phx.gbl...
> I'm looking to copy folders from one drive to another but I want the
> script to look inside a .txt file and only move the folders that are named
> in the text file. I know how to move one folder at a time with a script
> but I don't know how to get the script to look inside a .txt file to do
> it. Can anyone help.
>
> Thanks,
> KB
>