Windows: Start WiFi/WLAN Network Connection Dialog from command line or C#

Hi,

to start the Windows Wireless Connection Dialog from a command shell use the following command line

C:\> rundll32.exe %SystemRoot%\system32\van.dll,RunVAN

Here a C# example

using System.Diagnostics;
string sBinRundll32 = System.IO.Path.Combine(new string[] { Environment.SystemDirectory,  "rundll32.exe" });
string sWIFIDialogParameter = System.IO.Path.Combine(new string[] { Environment.SystemDirectory,  "van.dll" }) + @",RunVAN";
try
{
      System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable();
}
catch (Exception Ex)
{
      string sBinRundll32 = System.IO.Path.Combine(new string[] { Environment.SystemDirectory,  "rundll32.exe" });
      string sWIFIDialogParameter = System.IO.Path.Combine(new string[] { Environment.SystemDirectory,  "van.dll" }) + @",RunVAN";
      System.Diagnostics.Process.Start(sBinRundll32, sWIFIDialogParameter);
}

Leave a Reply Cancel reply