Microsoft KB Archive/84791

{|
 * width="100%"|

Associating Files and Passing Command-Line Parameters

 * }

Q84791

-

The information in this article applies to:


 * Microsoft Windows versions 3.0, 3.0a, 3.1, 3.11

-

SUMMARY
Microsoft Windows versions 3.0 and 3.0a support the use of command-line parameters in the File Associations dialog box in File Manager. Microsoft Windows version 3.1 does not support the use of command-line parameters in the File Manager Associate dialog box. Command-line parameters for use with file associations can be set up through the registration information database by using the Registration Information Editor (REGEDIT.EXE).

MORE INFORMATION
To use (pass) command-line parameters, do the following:

 Run File Manager. From the File menu, choose Run. In the Command Line box, type regedit, and choose OK. In the Registration Information Editor, choose Add File Type from the Edit menu.  Fill in the information as follows:

Identifier - Keyword to describe the entry. For example: "Noteprint" File Type - Program name and version. For example: "Notepad v3.1" Action - Select the Open option button.

Command - Program and command-line parameters. For example: "notepad.exe /p %1" where &quot;/p&quot; = print and &quot;%1&quot; = pass the filename

NOTE: You must type the fully-qualified pathname to the executable file (.EXE) if it is not on the path in the AUTOEXEC.BAT file, or you can use the Browse button to search for a program file.  From the File menu, choose Exit, which saves your changes. In File Manager, select a file with the extension you want to associate (for example, SETUP.TXT). From the File menu, choose Associate.</li> Confirm that the text in the Files With Extension box matches the extension you want to associate (in this case, TXT).</li> The Associate With box should contain the file type that was entered above in the Registration Information Editor (for example, Notepad 3.1).

NOTE: In this example, there may be more than one entry for Notepad. To use the entry with the correct command-line parameters, you must select the same file type as you previously entered (in this case, Noteprint).</li></ol>

Using the &quot;regedit /v&quot; command line gives advanced access to the registration database, giving you complete control of the contents of the registration database. If you use regedit /v in step 3 above, replace steps 7-10 above with the following:

<ol> Select the root by highlighting the backslash character (\) at the top of the file entry.</li> From the Edit menu, choose Add Key.</li>  Type the extension in the Key box and the identifier in the Value box, as follows:

Key - Extension. For example: ".TXT" Value - Identifier. For example: "Noteprint"</li> From the File menu, choose Exit, which saves the changes as you exit.</li></ol>

Additional query words: 3.10 3.11

Keywords :

Issue type :

Technology : kbWin3xSearch kbWin300 kbWin300a kbWin310 kbWin311