Okay, what I have is a program that reads from 2 selected folders. The way it works is by means of 2 separate "Browse" buttons that utilizes it's own folder browser dialog function. upon selecting the first folder, the folder contents populate a checked list box. the same goes for the second "Browse" button. However, the second button will populate not only the folder contents, but all sub-files as well.

Check box list 1(Folder 1/Selected from button1)

AB01.dwg
BA01.dwg
CA01.dwg
DA01.dwg
Check box list 2(Folder 2/selected from button2)

Folder 3(not seen in list)

Panels AB01.dwg
Folder 4(not seen in list)

Rake BA01.dwg
Folder 5(not seen in list)

Rafter CA01.dwg
Folder 5(not seen in list)

Column DA01.dwg
Now, I have 2 functions in the code. One looks for the name from list 1 and copies/renames the file with name from list 2 if the name from list 2 contains the same characters from list 1.
[code] Function FindListBox2ItemThatContains(ByVal listBox1FileName As String) As String For i As Integer = 0 To ListBox2.Items.Count - 1 If ListBox2.Items(i).Name.Trim.toupper.Contains(listBox1FileName.Trim.ToUpper) Then Return ListBox2.Items(i).Name.trim End If Next Return "" End Function[/code] next, i have a third button that runs the code, and copies/pastes the new files into location using the file from list 1 and renames it with the file from list 2. the saved location used to be specified by the user, but now i need the code to just overwrite the file from list 1 in it's current location. Here's the existing loop function...(note: the new path hasn't been finalized yet because i don't know how to code for it.
[code]For Each file As IO.FileInfo In ListBox1.CheckedItems Dim NewFileName As String = FindListBox2ItemThatContains(file.Name) If NewFileName.Trim.Length > 0 Then IO.File.Copy(file.FullName, IO.Path.Combine(FBD2.SelectedPath, "item parent folder", NewFileName.Trim), True) ProgressBar1.Increment(+1) Next[/code] how do i retrieve the file location from list 2, and save the new file in that location?

[img]https://social.msdn.microsoft.com/Forums/getfile/1011313[/img]