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);
}
Advertisment to support michlstechblog.info

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.