Your problem is that
lstFiles.Items(c)
is of the type
ListViewItem
. Thus you'll have to use the property
Text
to retrieve the path.
ToString()
will return something that will contain the type information including the actual path information and thus will not be suitable for your purposes.
I hope this helps you clear the issue!
[Edit]
This small code sample may be in C#, but it works like charm in copying all the files from
D:\Test\Tes
t into the subdirectory
D:\Test\Test\Test
where they are stored as 0, 1, 2, etc. :
static void Main(String[] args)
{
string[] entries = Directory.GetFiles(@"d:\Test\Test\");
for(int c = 0; c < entries.Length; c++)
{
System.IO.File.Copy(entries[c], String.Format(@"D:\Test\Test\Test\{0}", c.ToString()));
}
Console.ReadLine();
}
Maybe a piece of working code will show you where you went wrong!
[/Edit]
—MRB