I want to create a program that I can create a Text file folder on my desktop and move all the text files into the folder.
Here is what I have so far:
Below is where I create the Text folder:
Dim myPath As String = IO.Path.Combine(My.Computer.FileSystem.SpecialDirectories.Desktop, "Text") IO.Directory.CreateDirectory(myPath)
Here is where I am trying to move all of the .txt files to the new Text folder:
For Each foundFile As String In My.Computer.FileSystem.GetFiles _ (My.Computer.FileSystem.SpecialDirectories.MyDocuments, _ FileIO.SearchOption.SearchTopLevelOnly, "*.txt")
Here is where the error is: It won't do it...
My.Computer.FileSystem.MoveFile(foundFile, myPath & "/" & foundFile)
Do you have any tips for moving the .txt files to the Text folder?