azareth 5 Posting Whiz in Training

I'm having this kind of error: Could not find a part of the path.

For Each subfolder As String In Directory.GetDirectories(sourceDir)
            Dim destDir As String = Path.Combine(destinationDir, Path.GetFileName(subfolder))
            If destDir = destinationDir & "\peanutButter" Then
                'do nothing
                Directory.Move(subfolder, destDir)
            End If

I suppose i get this error because the folder hasn't been made yet in destDir, but i assumed that if vb doesn't found the path it will create the folder by itself..

and i've tried adding a code to check if the folder doesn't exist, it will create then, but i get an error that this time it cannot create because the path already exists.

what i want to do is to transfer all files/folder to another folder excluding the \peanutButter folder
i've tried different approaches into making this but i always get this error


Begginnerdev commented: +1 for figuring it out! =D +8