|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 (permalink) |
|
Messages: n/a
Hébergeur: |
"Vemula" <Vemula@discussions.microsoft.com> wrote in message news:8F570640-B8C8-4D4D-A2DD-86F984A49CDC@microsoft.com... > Hi can some one me. > I am copying the files whouse location is given ina text file ie. > coomputerlist.txt to a folder d:\archive.I am reading the contents of the > file from where i will pick the source location of the file.all the files > here are located at different folders. > when iam running the script iam getting an error: filenot found.I think it > is unable to read the source file in the methord objFSO.CopyFile filename > "D:\Archive\" > which in a variable filename. > can some me its very urgent. > > Dim filename > Const OverwriteExisting = True > Const inputfile = "c:\computerlist.txt" > Set ifso = CreateObject("Scripting.Filesystemobject") > Set ifile = iFSO.OpenTextFile(inputfile) > Set objFSO = CreateObject("Scripting.FileSystemObject") > Do until ifile.AtEndOfLine > Filename = ifile.ReadLine I'd suggest that you add code to determine exactly what has been read into the variable, perhaps something like: wscript.echo "[" & filename & "]" It could be, for example, that the filenames listed in the text file have a stray blank character on the end, or that the path is not fully qualified. /Al > objFSO.CopyFile filename "D:\Archive\" > Loop |
|
![]() |
| Outils de la discussion | |
|
|