I have the following code to connect to wi-fi, which works fine.

Dim p = "netsh.exe"
Dim wi-fi-name as string = "My-Wi-Fi-Connection"
    Dim sInfo As New ProcessStartInfo(p, "wlan connect " & wi-fi-name)

    sInfo.CreateNoWindow = True
    sInfo.WindowStyle = ProcessWindowStyle.Hidden
    Process.Start(sInfo)

    For i As Integer = 0 To 100
        Application.DoEvents()
        System.Threading.Thread.Sleep(10)
    Next

I want to be able to turn it off, changing connect to disconnect does not work.
Any suggestions much appreciated

Take a look Here

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.