I installed the Windows 8.1 Preview about a week ago and noticed very quickly that there is a bug where the Wi-Fi connection will just stop working once in a while. In my research, I found that this is a very common bug on laptops and that it is being worked on.
I found that the only real solution to the bug is to disable Wi-Fi and the re-enable it. This is easy on laptops that have a switch that does just that. However, my laptop doesn't have such a switch. It soon became very annoying to have to go into the 'Network Connections' control panel to disable and re-enable the adapter.
So, I developed a small application that will test to see if your Wi-Fi connection is usable and then do the above steps if needed. I figured I'd put it here for anybody who might find it useful. I've also posted the source code just in case anybody is curious.
Mirror
I found that the only real solution to the bug is to disable Wi-Fi and the re-enable it. This is easy on laptops that have a switch that does just that. However, my laptop doesn't have such a switch. It soon became very annoying to have to go into the 'Network Connections' control panel to disable and re-enable the adapter.
So, I developed a small application that will test to see if your Wi-Fi connection is usable and then do the above steps if needed. I figured I'd put it here for anybody who might find it useful. I've also posted the source code just in case anybody is curious.
Code:
using System;
using System.Diagnostics;
using System.Net;
using System.Net.NetworkInformation;
using System.Threading;
namespace WiFiFixer
{
internal class Program
{
private static void Main(string[] args)
{
bool wiFiFixed = false;
ProcessStartInfo disable = new ProcessStartInfo("netsh", "interface set interface name=\"Wi-Fi\" admin=disabled");
disable.WindowStyle = ProcessWindowStyle.Hidden;
ProcessStartInfo enable = new ProcessStartInfo("netsh", "interface set interface name=\"Wi-Fi\" admin=enabled");
enable.WindowStyle = ProcessWindowStyle.Hidden;
Console.WriteLine("Checking connection status...");
if (PingTest())
{
Console.WriteLine("Connection is good. Exiting.");
wiFiFixed = true;
return;
}
else
{
while (!wiFiFixed)
{
Console.WriteLine("Disabling Wi-Fi network interface...");
var disableProcess = Process.Start(disable);
disableProcess.WaitForExit();
Console.WriteLine("Enabling Wi-Fi network interface...");
var enableProcess = Process.Start(enable);
enableProcess.WaitForExit();
Console.WriteLine("Checking connection status...");
Thread.Sleep(5000);
if (PingTest())
{
wiFiFixed = true;
}
}
}
}
private static bool PingTest()
{
Ping ping = new Ping();
PingReply pingStatus = ping.Send(IPAddress.Parse("74.125.225.196")); //This is Google.com
if (pingStatus.Status == IPStatus.Success)
{
return true;
}
else
{
return false;
}
}
}
}
Mirror
Attachments
Last edited:
My Computer
System One
-
- OS
- Windows 8.1 Pro
- Computer type
- Tablet
- System Manufacturer/Model
- Lenovo
- CPU
- Atom Z2760
- Motherboard
- Lenovo K3011W
- Memory
- 2GB DDR3
- Graphics Card(s)
- N/A
- Screen Resolution
- 1366x768
- Hard Drives
- Samsung 64GB eMMC
- Mouse
- HP Bluetooth
- Internet Speed
- 50Mbps
- Browser
- Internet Explorer 11
- Antivirus
- Malwarebytes Anti-Malware