Microsoft KB Archive/66083

{|
 * width="100%"|

WIN.COM Ignores Command Line Parameters After File Name

 * }

Q66083

-

The information in this article applies to:


 * Microsoft Windows versions 3.0, 3.0a

-

SUMMARY
Microsoft Windows version 3.0 can use a number of start-up parameters from the MS-DOS prompt. If the Windows 3.0 WIN.COM file cannot recognize a parameter, Windows assumes it is a filename and tries to run that file. The only parameters recognized by WIN.COM are /2, /3, /S, /E, /L, /N, and /R. If the parameter is not a valid filename, Windows generates the following message box:

Cannot find file. Check to ensure that the path and file name are correct.

MORE INFORMATION
Using WIN  allows you to run an application after starting Windows. However, you can only run one application this way; all parameters after the first filename are passed down to the application as an associated file to load (such as a text or document file). The following examples demonstrate how Windows uses parameters when starting:


 * Type WIN NOTEPAD to bring up Windows with one Notepad open to the file NOTEPAD.TXT.
 * Type WIN NOTEPAD NOTEPAD NOTEPAD to bring up Windows with one Notepad. In this case, NOTEPAD.EXE tries to open the file &quot;NOTEPAD NOTEPAD.TXT,&quot; which is an invalid filename that generates the above error message.
 * Type WIN NOTEPAD /R to bring up Windows with Notepad open. NOTEPAD.EXE attempts to open &quot;/R.TXT,&quot; causing an error.
 * Type WIN /R NOTEPAD to bring up Windows in real mode with Notepad open.
 * Type WIN /Q /R to bring up Windows and the &quot;Cannot find file&quot; message box. This is because &quot;/Q&quot; is not a valid command line parameter for WIN.COM. Windows assumes that &quot;/Q&quot; is the name of an application you want to run, and looks for &quot;/Q.EXE&quot;. Because &quot;/Q.EXE&quot; is not a valid filename, it cannot be found, and Windows returns an error message. The /R parameter is discarded because it is assumed to be a parameter to the (nonexistent) &quot;/Q.EXE&quot;.