Hacer una función EscribeTextoFichero a la que se le pasan dos cadenas. La primera es el nombre del fichero y la segunda es el texto que se deberá escribir dentro del fichero.

Imports System.IO

Module Module1

    Sub Main()
        Dim s As String
        Dim i As Integer
        Dim f As String
        Console.Write("Dame una ruta y nombre de fichero: "Wink
        f = Console.ReadLine
        Console.Write("Dame una cadena: "Wink
        s = Console.ReadLine
        escribeenfichero(f, s)
        Console.ReadKey()
    End Sub
    Sub escribeenfichero(ByVal nombrefich As String, ByVal texto As String)
        Dim sw As StreamWriter
        sw = New StreamWriter(nombrefich)
        sw.WriteLine(texto)
        sw.Close()

    End Sub
End Module