Question: I am trying to create a simplistic program that will search for an image using the users input, in a specific folder, if the image exists, then creates a copy of that image to another folder. The user may not have the whole name, for example, the image name could be `iStock-454565767`, The user would be able to just input the numbers without the `istock`.

We use thousands of istock photos that have been purchased and are housing them in one file, which makes searching for specific images difficult, especially when we may need several at one time.

I have this code:

```vb
Private Sub btnSearch_Click(sender As Object, e As EventArgs) Handles btnSearch.Click
    Dim FSO, sourceFolder, currentFile, filesInSourceFolder
    Dim strSourceFolderPath As String
    Dim strDestinationFolderPath As String
    Dim strUserInput As String
    FSO = CreateObject("Scripting.FileSystemObject")

    strUserInput = txtSearch.Text
    strSourceFolderPath = "C:\Users\D41071023\Desktop\Photo Database"
    strDestinationFolderPath = "C:\Users\D41071023\Desktop\test"

    sourceFolder = FSO.GetFolder(strSourceFolderPath)
    filesInSourceFolder = sourceFolder.Files

    For Each currentFile In filesInSourceFolder
        If currentFile.Name = strUserInput Then
            currentFile.Copy(FSO.BuildPath(strDestinationFolderPath,
            currentFile.Name))
        End If
    Next
End Sub

```

When I click "Search" nothing happens. No file is created, there's not even an error. Also, I want to add a message box that pops up when the file has been created, or a message that lets the user know that the image was not found.

Answer: 
Upto my understanding,

```vb
Dim sourceFolderPath = "source folder path here" ' Folderpath without spaces
Dim fileNumber = "file number here"

Dim sourceFilePath = Directory.GetFiles(sourceFolderPath, $"iStock-{fileNumber}.png").FirstOrDefault()

If Not IsNothing(sourceFilePath) Then
    Dim destinationFolderPath = "destination folder path here" 'Folderpath without spaces
    Dim sourceFileName = Path.GetFileName(sourceFilePath)
    Dim destinationFilePath = Path.Combine(destinationFolderPath, sourceFileName)

    File.Copy(sourceFilePath, destinationFilePath)
    MsgBox("File " & "iStock-{fileNumber}.png" & " found.", MsgBoxStyle.OkOnly)
else 
    MsgBox("File not found  .  .  .  ", MsgBoxStyle.OkOnly + MsgBoxStyle.Information)
End If

```
If I'm understanding you correctly, this is the sort of thing that you should have:

```vb
Dim sourceFolderPath = "source folder path here"
Dim fileNumber = "file number here"

Dim sourceFilePath = Directory.GetFiles(sourceFolderPath, $"iStock-{fileNumber}.png").SingleOrDefault()

If sourceFilePath IsNot Nothing Then
    Dim destinationFolderPath = "destination folder path here"
    Dim sourceFileName = Path.GetFileName(sourceFilePath)
    Dim destinationFilePath = Path.Combine(destinationFolderPath, sourceFileName)

    File.Copy(sourceFilePath, destinationFilePath)
End If

```