WIN.COM Ignores Command Line Parameters After File Name (66083)



The information in this article applies to:

  • Microsoft Windows 3.0
  • Microsoft Windows 3.0a

This article was previously published under Q66083

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 <application name> 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 "NOTEPAD NOTEPAD.TXT," 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 "/R.TXT," 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 "Cannot find file" message box. This is because "/Q" is not a valid command line parameter for WIN.COM. Windows assumes that "/Q" is the name of an application you want to run, and looks for "/Q.EXE". Because "/Q.EXE" 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) "/Q.EXE".

REFERENCES

"Microsoft Windows User's Guide," Version 3.00, Pages 427-432.

Modification Type:MinorLast Reviewed:7/7/2005
Keywords:KB66083