Yes, return
Path.ChangeExtension( folder, "txt")
This can be your modified code to do the file checking properly too-
Private Function GetTempFolder() As String
Dim folder As String = Path.ChangeExtension(Path.Combine(Path.GetTempPath, Path.GetRandomFileName))
Do While Directory.Exists(folder) Or File.Exists(folder)
folder = Path.ChangeExtension(Path.Combine(Path.GetTempPath, Path.GetRandomFileName))
Loop
Return folder
End Function
Though that repetition is really bugging me xD