<!-- Download Links -->
<!-- Add the rest of your HTML here -->
This article discusses in detail how to detect whether any modem is present in your system. If not how to start the installation of the Modem programatically. It also detects whether RAS,DUN is already installed and if not how to start the installation of the same programatically.
Detecting and Installing Modem
To detect whether modem is present in your system, we have to check out the registry. If your OS version is Platform Win32 NT, ie, Windows NT or XP or 2000, then we have to open the key
else if your OS version is Platform Win32 Windows, i.e., 9x or ME, then we have to open the key
and count the number of sub-keys under it. If any modem is present then the count will be greater than or equal to 1. If it is less than 1 then it means there is no modem present in the system.
To install the modem, just execute the Control Panel applet for Modem, and give the commannd line arguement as add, ie,
"rundll32.exe shell32.dll,Control_RunDLL Modem.cpl,,add",1
Detecting and Installing RAS or DUN
To detect whether RAS is installed in OS version Platform Win32 NT, try opening the registry key
if its successful, then RAS is already installed in your system. If its unsuccessful, then you can start the installation of the same by executing
To detect whether Dial-up Networking is installed in OS version Platform Win32 Windows, except Windows ME, try opening the registry key
if its successful, then Dial-up is installed for Windows ME, open the registry key
and query the value
if the value is 1 then Dial-up is installed.
Otherwise, install the same by executing
"rundll.exe setupx.dll,InstallHinfSection rna 0 rna.inf"
This is tested OK on all Windows OS. If you find any odd thing kindly let me know.