WIN.INI Programs= Line, File Extensions, and Execution Order

Last reviewed: November 21, 1994
Article ID: Q90708
The information in this article applies to:
  • Microsoft Windows operating system versions 3.0, 3.0a, 3.1, 3.11

SUMMARY

Windows looks at file extensions and filenames when searching for and running executable files specified on the command line accessed by choosing Run from the File. This is slightly different than the method used by MS- DOS, and can affect processing order.

MORE INFORMATION

The MS-DOS command processor ignores filename extensions at first and looks in itself for a string matching the command to be processed. If it finds none, it looks in the current directory and then along the PATH for filenames matching the issued command and having, in this order, the .COM, .EXE, or .BAT extension. This is a search order only -- MS-DOS always executes .COM files before .EXE files, regardless of any extension you specify on the command line. If, for instance, it finds a MYPROG.COM and a MYPROG.EXE in the same place, MS-DOS always runs MYPROG.COM first. However, the processor runs MYPROG.EXE before MYPROG.COM if MYPROG.EXE is found first during the PATH search.

Windows behaves differently, using the executable file extension defined in the Programs= line of WIN.INI. The typical listing order for executable extensions is COM, EXE, BAT, and PIF. If you choose Run from the File menu in File Manager or Program Manager, and enter the string MYPROG without an extension in the command line, Windows executes MYPROG.COM before MYPROG.EXE. If you specify the full name and extension in the command line, Windows uses the extension to determine which file to load. While this also is true of MS-DOS, Windows allows you to change the search order.

If you run only Windows executable files and do not specify an extension, you may be able to boost system performance slightly by listing .EXE files before .COM files.

REFERENCES

"Microsoft Windows User's Guide," version 3.0, pages 52-53

WININI.TXT file included with Windows 3.0

"Microsoft Windows User's Guide," version 3.1, page 134

WININI.WRI file included with Windows 3.1


KBCategory: kbusage kbother
KBSubcategory: win31
Additional reference words: 3.00 3.00a 3.10 3.11 executables


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: November 21, 1994
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.