Click here to Skip to main content
Click here to Skip to main content
Go to top

Detecting and Installing Modem and RAS, Dial-up Network.

, 15 May 2002
Rate this:
Please Sign up or sign in to vote.
Detecting whether Modem and Dial-up Networking is installed in your system. If not, installing them programatically.
<!-- Download Links --> <!-- Add the rest of your HTML here -->

Introduction

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

  HKEY_LOCAL_MACHINE,
    "SYSTEM\\CurrentControlSet\\Control\\Class\\"
    "{4D36E96D-E325-11CE-BFC1-08002BE10318}" 
else if your OS version is Platform Win32 Windows, i.e., 9x or ME, then we have to open the key
  HKEY_LOCAL_MACHINE,"System\\CurrentControlSet\\Services\\Class\\Modem" 
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

 HKEY_LOCAL_MACHINE,"SYSTEM\\CurrentControlSet\\Services\\RemoteAccess" 
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
 rasphone.exe 

To detect whether Dial-up Networking is installed in OS version Platform Win32 Windows, except Windows ME, try opening the registry key

 HKEY_LOCAL_MACHINE,
    "System\\CurrentControlSet\\Services\\RemoteAccess\\NetworkProvider" 
if its successful, then Dial-up is installed for Windows ME, open the registry key
 HKEY_LOCAL_MACHINE,"SOFTWARE\\Microsoft\\Windows\\"
    "CurrentVersion\\Setup\\OptionalComponents\\RNA\\" 
and query the value
 "Installed" 
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" 

Conclusion

This is tested OK on all Windows OS. If you find any odd thing kindly let me know.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Parasuraman SundarRajan
Web Developer
India India
Sundar is having 6 years of experience in VC++. and .NET for 2+ year. Has developed the Internet Dialer for Asia's No.1 leading ISP. Involved in developing Video Surveillance components for worlds leading Security Surveillance Software Company. Worked and working on various domains such as Internet Networking, Video Codecs, CCTV Surveillance Software, Video Portals, Windows Mobile, PDAs etc. Also working on various projects which involves RAS, TCP/IP, FTP, COM, XML, .NET, Remoting, Embedded programming.

Comments and Discussions

 
QuestionProgrmatically Creating New Modem PinmemberRangaraman12-Jul-12 3:27 
QuestionGetting Baud rate using RAS api Pinmemberkumar_vinit25-Jul-06 21:29 
AnswerRe: Getting Baud rate using RAS api Pinmemberdaluu16-Oct-07 14:29 
Generaldial-in connections PinsussVicenç García-Altés9-Jun-05 23:07 
Generaldial-in connections PinsussVicenç García-Altés9-Jun-05 23:07 
Generalrasphone.exe PinsussAnonymous11-May-05 0:33 
GeneralQuery regarding dialing Pinmembernavinkaus27-Aug-04 22:50 
QuestionAnybody help me? Pinsussvan minh28-Aug-02 6:28 
AnswerRe: Anybody help me? Pinmemberabibok14-Jun-06 2:45 
QuestionHow to detect modem in remote machine Pinmemberbluemoon30-May-02 14:44 
GeneralOld entries... PinmemberDaniel Desormeaux17-May-02 3:45 
GeneralRe: Old entries... PinmemberParasuraman SundarRajan22-May-02 21:03 
GeneralRe: Old entries... PinmemberDaniel Desormeaux24-May-02 5:22 
GeneralRe: Old entries... PinmemberBrendan Fergusson27-May-02 1:30 
GeneralRe: Old entries... PinmemberDaniel Desormeaux28-May-02 10:31 
GeneralRe: Old entries... PinmemberBrendan Fergusson28-May-02 19:58 
GeneralRe: Old entries... PinmemberDaniel Desormeaux29-May-02 10:21 
GeneralRe: Old entries... Pinmembercoolvcguy25-Aug-03 11:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web03 | 2.8.140922.1 | Last Updated 16 May 2002
Article Copyright 2002 by Parasuraman SundarRajan
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid