Microsoft KB Archive/72158

{|
 * width="100%"|

Using run= and load= with Command Line Parameters in Windows

 * }

Q72158

-

The information in this article applies to:


 * Microsoft Windows versions 3.0, 3.0a

-

SUMMARY
The run= and the load= lines of the WIN.INI file do not allow programs that accept command line parameters. A workaround is to set up a file association for the data file, causing Windows to load the application with the data file and run the other parameters.

MORE INFORMATION
A file association is an entry in the [Extensions] section of the WIN.INI file that tells Windows what data file extensions an application uses. This allows you to double-click a data file in File Manager and have Windows start the application with the data file loaded.

Windows Applications
Let's say you have a program called ONE.EXE that accepts a filename, and has keystrokes to start macros as command line parameters. At the DOS prompt you could use the following command to load this file in the application during startup.

"win one testfile.one a" If you want to do this with the run= or load= statements in the WIN.INI file, you will need to make the following changes:

 Create a file association:

 Start File Manager from Windows. Highlight TESTFILE.ONE. From the File menu, choose Associate. Type c:\one\one.exe a and choose OK.   Add the following to the run= line in the [windows] section of the WIN.INI file: "run=c:\one\myfiles\testfile.one"

When Windows recognizing the association of &quot;.ONE&quot; to be ONE.EXE, Windows will load ONE.EXE with the document and run the macro assigned to the A keystroke.

MS-DOS Applications
MS-DOS applications allow for a more extensive use of command line parameters through the use of a PIF file. To start a MS-DOS application with command line parameters, use the following procedure:

 Create a PIF file for the MS-DOS program. For more information about this procedure, see the &quot;Microsoft Windows User's Guide,&quot; beginning on page 440.</li> On the Optional Parameters line of the PIF, add the appropriate command line parameters for the MS-DOS application.</li>  Add the name of the PIF file to the WIN.INI file: "run=c:\one\one.pif"</li></ol>

The run= line causes the PIF file to be invoked, starting the MS-DOS application with the command line parameters.

Additional query words: 3.00 win30 3.00a

Keywords :

Issue type :

Technology : kbWin3xSearch kbWin300 kbWin300a