Click here to Skip to main content
13,141,576 members (54,940 online)
Click here to Skip to main content
Add your own
alternative version

Stats

125.1K views
4K downloads
31 bookmarked
Posted 13 May 2002

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

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.

You may also be interested in...

Pro
Pro

Comments and Discussions

 
QuestionProgrmatically Creating New Modem Pin
Rangaraman12-Jul-12 3:27
memberRangaraman12-Jul-12 3:27 
QuestionGetting Baud rate using RAS api Pin
kumar_vinit25-Jul-06 21:29
memberkumar_vinit25-Jul-06 21:29 
AnswerRe: Getting Baud rate using RAS api Pin
daluu16-Oct-07 14:29
memberdaluu16-Oct-07 14:29 
Generaldial-in connections Pin
Vicenç García-Altés9-Jun-05 23:07
sussVicenç García-Altés9-Jun-05 23:07 
Generaldial-in connections Pin
Vicenç García-Altés9-Jun-05 23:07
sussVicenç García-Altés9-Jun-05 23:07 
Generalrasphone.exe Pin
Anonymous11-May-05 0:33
sussAnonymous11-May-05 0:33 
GeneralQuery regarding dialing Pin
navinkaus27-Aug-04 22:50
membernavinkaus27-Aug-04 22:50 
QuestionAnybody help me? Pin
van minh28-Aug-02 6:28
sussvan minh28-Aug-02 6:28 
AnswerRe: Anybody help me? Pin
abibok14-Jun-06 2:45
memberabibok14-Jun-06 2:45 
QuestionHow to detect modem in remote machine Pin
bluemoon30-May-02 14:44
memberbluemoon30-May-02 14:44 
GeneralOld entries... Pin
Daniel Desormeaux17-May-02 3:45
memberDaniel Desormeaux17-May-02 3:45 
GeneralRe: Old entries... Pin
Parasuraman SundarRajan22-May-02 21:03
memberParasuraman SundarRajan22-May-02 21:03 
GeneralRe: Old entries... Pin
Daniel Desormeaux24-May-02 5:22
memberDaniel Desormeaux24-May-02 5:22 
GeneralRe: Old entries... Pin
Brendan Fergusson27-May-02 1:30
memberBrendan Fergusson27-May-02 1:30 
GeneralRe: Old entries... Pin
Daniel Desormeaux28-May-02 10:31
memberDaniel Desormeaux28-May-02 10:31 
GeneralRe: Old entries... Pin
Brendan Fergusson28-May-02 19:58
memberBrendan Fergusson28-May-02 19:58 
GeneralRe: Old entries... Pin
Daniel Desormeaux29-May-02 10:21
memberDaniel Desormeaux29-May-02 10:21 
GeneralRe: Old entries... Pin
coolvcguy25-Aug-03 11:32
membercoolvcguy25-Aug-03 11:32 

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

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

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170915.1 | Last Updated 16 May 2002
Article Copyright 2002 by Parasuraman SundarRajan
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid