Export (0) Print
Expand All

Appendix C - Understanding Modem.inf

Archived content. No warranty is made as to technical accuracy. Content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

RAS now supports modems through the Universal Modem Driver (Unimodem) and continues to support modems described in this chapter for older legacy systems. To configure a previously installed unsupported modem to work with the Remote Access Service, add an entry for that modem in the Modem.inf file.

For more information on Unimodem, see the files Mdk.doc and Reg.doc at the following location: ftp://ftp.microsoft.com/developr/drg/modem/modemdev.exe.

Modemdev.exe is a self-extracting compressed file. Run it to obtain Mdk.doc and Reg.doc.

Note The files are Windows 95 documents that are also relevant to Windows NT except for the following areas:

  • Plug and Play (PnP) 

  • Voice INF structures 

  • VoiceView support 

  • Parallel port modems

The Modem.inf File

The Modem.inf file lists all modems supported by Remote Access, along with the command and response strings each modem needs for correct operation. When you select a modem during Remote Access installation, the Setup program associates the selected modem with the specified communication port. Remote Access connection utilities read Modem.inf to obtain the command strings for the modem associated with each communication port. You can find Modem.inf in the \systemroot\system32\ras directory.

The Modem.inf file consists of two main parts:

  • A global [Responses] section 

  • Individual sections for each supported modem, such as [Hayes V 9600] 

Each section contains the following four components. The first three must appear in the order given. Comment lines can appear anywhere.



Section header

Only one

Configuration parameters and substitution macros

Zero or more


One or more

Comment lines

Zero or more


A command-response set consists of one command followed by zero or more responses. Responses are strings expected from the device; they can contain macros. Responses take the following form:


The Modem.inf file contains two types of responses:

Type of response



In the [Responses] section


Immediately following the command line that is expected to produce the response, and before the next command line

A modem can match any response. If the modem returns only carrier bps, put the expected responses in the private modem section; if the modem returns connect bps or both carrier bps and connect bps, put the expected responses in the global section. To find out which bps string(s) your modem returns, see the modem documentation.

Global Responses

Responses used by most modems are in the global [Responses] section of Modem.inf. For example:

CONNECT_V42=<cr><lf>CONNECT <connectbps> RELIABLE EC=(LAPM) \ DC=(None)<cr><lf>

The only information contained by LOOP is that another response is coming. Remote Access then waits for that response before moving on. Any response keyword beginning with LOOP or LOOP_ acts this way.

Private Responses

Specific Modem.inf sections can contain private response strings. Remote Access checks for private responses first. If it doesn't find a response string to match the actual string returned by the modem, it continues checking in the global response section. There is one exception: If the first part of a string containing an <append> macro is matched in the private section, the global section will not be searched. Instead, Remote Access waits a few seconds for the rest of the string to arrive from the modem.

For information about adding an entry to Modem.inf, see "Adding a New Modem to Modem.inf," in this appendix.

The following example shows a section with private responses. Microsoft encourages you to use this method of inserting responses for any section you add.

CONNECT=<cr><lf>CONNECT <carrierbps><cr><lf>
CONNECT_EC=<cr><lf>CONNECT <carrierbps>/MNP<cr><lf>
CONNECT_EC=<cr><lf>CONNECT <carrierbps>/MNP/COMPRESSED<cr><lf>
CONNECT_EC=<cr><lf>CONNECT <carrierbps>/MNP COMPRESSED<cr><lf>
CONNECT_EC=<cr><lf>CONNECT <carrierbps>/V42<cr><lf>
CONNECT_EC=<cr><lf>CONNECT <carrierbps>/V42BIS<cr><lf>


Modem.inf file syntax consists of two components: section headers and configuration parameters.

Section Headers

A section header is a string of up to 32 characters between square brackets, and it occupies the first line in each section. It identifies the specific device to which the section applies. In Modem.inf, the section header typically lists the modem make and model. For example, [Hayes V 9600].

Configuration Parameters

Remote Access works with the modem through configuration parameters, which take the following form:


For example:


Substitution Macros

Substitution macros are placeholders that are replaced in command strings. Macros follow these rules:

  • In the Modem.inf file, macros must come before the first command and, by convention, after the configuration parameters. 

  • Macro names must be enclosed in angle brackets (< >). 

For example:


There are two types of macros:

Macro Type








The command AT<reset><cr> would be sent as AT&F<cr>. Binary macro placeholders are replaced according to instructions from the user. For example, if the user disables the speaker, the command AT<speaker><cr> is sent as ATM0<cr>. If the user enables the speaker, it is sent as ATM1<cr>.

Some responses can also use macros. Most macros in response strings behave as they do in commands. However, certain macros (such as <carrierbps> and <diagnostics>) capture information such as baud rate from the device response string.

Nested macros are not allowed. Two adjacent left angle brackets are interpreted as a less than sign, and two adjacent right angle brackets are interpreted as a greater than sign. This allows greater than and less than symbols to be used in a command string when required.

The macros in the following list are reserved words: You cannot define them in Modem.inf when creating a new macro. Reserved words are case insensitive.

  • carrierbps 

  • connectbps 

  • message 

  • phonenumber 

  • cr 

  • lf 

  • match 

  • ? 

  • append 

  • hXX 

  • ignore 

Caution These macros are defined internally and can be used in Modem.inf, just as phonenumber is used in the COMMAND_DIAL= string.

For additional reserved words, see "PAD.INF Format," in Chapter 9, "X.25 PAD Support."

Table C.1 lists macros defined in the file's Modem.inf. Always enclose these macros in angle brackets (< >).




Turns the modem speaker on or off.


Turns the error correction protocol on or off.


Turns modem compression on or off.


Tells the modem whether to use hardware flow control between the COM port and modem.


Inserts a carriage return.


Inserts a line feed.


Reports a match if the string enclosed in quotation marks is found in the device response. For example, <match>"Smith" matches Jane Smith and John Smith III.


Inserts a wildcard character, for example, CO<?><?>2 matches COOL2 or COAT2, but not COOL3.


Causes information to be broken into two segments and received from the modem one segment at a time. The client expects delays between the segments and waits until all the information has arrived. See the sample Modem.inf file for an example.

hXX (XX are hexadecimal digits)

Allows any hexadecimal character to appear in a string including the zero byte, <h00>.


Ignores the rest of a response from the macro on. For example, <cr><lf>CONNECTV-<ignore> reads the following responses as the same: "crlfCONNECTV-1.1" and "crlfCONNECTV-2.3."

In Table C.1, the first four macros (speaker, protocol, compression, and hwflowcontrol) are binary macros. Define them, using the speaker example (first example in this section) as a model.

As values, use them as shown in the following example:


This command sends ATM1<cr> to the modem if the speaker is to be turned on and ATM0<cr> if the speaker is to be turned off. Through the Remote Access Phone Book, the user determines which macros are to be on or off. The Phone Book then reads the Modem.inf file to find out which value string to send to the modem. Note that value strings sometimes differ among modems.

The Remote Access Service uses the last five macros in the Table C.1 (match, ?, append, hXX, and ignore) in response strings to recognize responses from a modem or another device.


Commands are strings of characters sent to the modem. These strings can contain macros and take the following form:

command_keyword = value_string 

The set of command keywords (or types) is as follows:




The Modem.inf file initializes the modem, dials a phone number, and puts the modem into answer mode with the command types COMMAND_INIT, COMMAND_DIAL, and COMMAND_LISTEN. Commands of a given type are executed in the order found in the Modem.inf file. By convention, commands of the same type are grouped together, as shown in the following example from Modem.inf:

COMMAND_INIT=AT&F&C1&D2 V1 S0=0 S2=128 S7=55 W0 S95=44<cr>
Multiple Command Strings

Because most modems accept strings of about 50 characters, the Remote Access Service supports multiple command strings. This allows you to break up long commands into strings the modem can accept.

For example, the first line could be rewritten as a multiple command string:

COMMAND_INIT=AT&F&C1&D2 V1 S0=0 S2=128 S7=55 W0 \ S95=44<speaker><protocol><compression><hwflowcontrol><cr>

COMMAND_INIT=AT&F&C1&D2 V1 S0=0 S2=128 S7=55 W0 S95=44<cr>

Notice that each string

  • Is a command in its own right 

  • Begins with AT and ends with a carriage return (<cr>) 

  • Gets a response before going to the next string 

Comment Lines

Comment lines convey important information to those who maintain the .INF files. Comment lines begin with a semicolon (;), and can appear anywhere in the file. For example:

; Explanation of modem commands
; &F Reset modem to factory default settings 
; &C1 DCD tracks presence of modem carrier
; &D2 Hangup & disable autoanswer when DTR goes from ON TO OFF
Line Continuation

A backslash (\) indicates that commands or responses are continued on the next line. Line continuations can make files more legible. A double backslash (\\) denotes a backslash.

For example:

<cr><lf>CARRIER <carrierbps><cr><lf><append>\
<cr><lf>PROTOCOL: V.42/LAPM<cr><lf>\
<cr><lf>COMPRESSION: NONE<cr><lf>\
<cr><lf>CONNECT <connectbps><cr><lf>


Assigning an Alias

If a modem's command strings are identical to those already listed for another modem, the name of the latter modem can be used as an alias for the former.

For example:

[QT Modem]
ALIAS=Codex 326X Fast

In this example, the QT modem uses command strings of a Codex 326X Fast modem.

An alias to an alias is not allowed. In other words, you cannot nest aliases. For example, to alias two modems to another modem, you must alias them directly:

[Modem 1]
;Modem 1's normal entries go here
[Modem 2]
ALIAS=Modem 1
[Modem 3]
ALIAS=Modem 1
;You cannot say ALIAS=Modem 2

Adding Modem Detection Information to Modem.inf

The command and response that enable Remote Access Setup to automatically detect modems are



Insert the appropriate modem identification command after the DETECT_STRING parameter, followed by <cr>. Then insert the response expected from the modem after the DETECT_RESPONSE parameter. For example:

[DataRace RediModem V.32bis]; Command sent is ATI3<cr>, and the response is ; "PC Half-Card V.32bis/V.42bis/Fax". Actually, the modem; might return more than just the string in quotation marks,; but all that is needed to make a positive identification is; the information in quotation marks.

If several possible responses might be returned for a specific modem, then for each DETECT_STRING command, list all possible combinations of responses. For example, the following section enables Setup to detect the [Datatrek 2424AMH] modem. Setup sends the ATI9 command and expects any one of the four possible responses to be returned.


If multiple commands are required to make a positive identification, list all the required commands and their corresponding responses. For example, the following section enables Setup to detect the [Intel 9600EX] modem. Setup expects specific responses for both the ATI0 and ATI3 commands in order to make a unique identification.


Adding a New Modem to Modem.inf

If you use a modem that is not explicitly supported in Modem.inf, you can append a new section containing the command strings the modem requires. The name of the section should be the name of your modem and should be enclosed in brackets. For information about macros used in building a new section, see "Substitution Macros," in this appendix.

Note To minimize the risk of corrupting existing modem sections, be sure to add new sections to the end of the Modem.inf file.

To edit Modem.inf for a new modem 

  1. Back up your existing Modem.inf file. 

  2. Copy an existing section to the end of Modem.inf and rename the section header of the copy to the name of your modem. For information about section headers, see "Section Headers," in this appendix. 

  3. Change MAXCONNECTBPS and MAXCARRIERBPS to the values of the new modem, and set values for CALLBACKTIME and DEFAULTOFF. For example: 

    DEFAULTOFF=speaker compression\

    Configuration parameter



    The maximum speed at which the client's modem and the Remote Access server's modem exchange data (bps rate on the telephone line). This speed is always equal to or less than MAXCONNECTBPS


    The maximum speed at which a modem talks to the computer (DTE to DCE bps transfer rate). Set this value to the maximum serial port bps that the modem can support. 


    The time in seconds that the server waits before calling the client back. This delay allows the client's modem to reset itself. Start with 10 seconds, and increase this number if there are problems. 


    A list of all the on/off macros that you want set to off by default, until turned on by Rasphone.exe. 

  4. Change the command strings for hwflowcontrol, protocol (error control), compression, and speaker. Check your modem's documentation for the correct values. 

    For example: 

    <protocol_off>=&Q0 S36=1
    <protocol_on>=&Q5 S36=5 S46=138

    Note If you don't find values for these commands in your modem's documentation, contact the modem manufacturer. If a modem does not support these features, omit these macros from Modem.inf. (If you omit a macro definition in step 4, be sure to also omit the same macro in the COMMAND_INIT string in step 5.)

  5. And finally, change the commands in the following example. Again, check your modem's documentation for the correct values. 

    COMMAND_INIT=AT&F&C1&D2 v1 s0=0 s2=128 s7=55 w1<cr>




Initializes the modem


Sets the modem to autoanswer mode. Check your modem's documentation for the value that makes the modem answer after the first ring. Insert this value for Remote Access servers and clients configured for callback.


Dials the phone number and connects. Do not enter an actual phone number here. Enter <phonenumber>, as shown in the example.

The following table lists the modes to which you should initialize your modem. The codes in the left column show examples of each mode. Codes like these form the COMMAND_INIT string. For the codes used by your modem, consult the modem's documentation.




Restores factory settings


Causes data carrier detect (DCD) to track the presence of a data carrier


Hangs up and disables autoanswer when the data terminal ready (DTR) signal goes from on to off (high to low)


Allows verbose (English words) return codes


Lowers the speaker volume


Lets the modem return result codes


Enables character echo in the command state


Answers on a certain ring number: S0=0 for COMMAND_INIT, S0=1 for COMMAND_LISTEN


Disables the escape character


Sets the carrier waiting time (to about 55 seconds)


Enables negotiation progress messages


Allows carrier, protocol, and compression messages

By being meticulous when you create a new modem section, you can reduce the need for debugging later. Microsoft also recommends that you document your work: Doing so allows others to quickly understand the entries and helps you remember your programming rationale. Be sure to type a semicolon (;) at the beginning of each comment line.

Important If you edit Modem.inf and your new modem does not work, restore the original version of the file and use one of the modems listed in the Hardware Compatibility List.


Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft