Native MS-DOS Commands and the Space Character

Last reviewed: April 11, 1997
Article ID: Q166827
The information in this article applies to:
  • Microsoft Windows 95
  • Microsoft Windows NT Server versions 3.5, 3.51, 4.0
  • Microsoft Windows NT Workstation versions 3.5, 3.51, 4.0

SUMMARY

Windows NT and Windows 95 use different command interpreters to process commands at a command prompt. Windows NT uses Cmd.exe, and Windows 95 uses Command.com. This can cause confusion when you are using native, or internal, commands (such as CHDIR, MKDIR, RMDIR, and so on) at a command prompt, particularly in conjunction with the space character.

MORE INFORMATION

Windows NT and Windows 95 may generate different results for the same command when typed at a command prompt. For example, the following command generates different results in Windows 95 and Windows NT:

   c:\>md This is a Directory

In Windows 95, this command generates the following error message:

   Too many parameters - is

In Windows NT, this command generates four separate folders:

   C:\This
   C:\is
   C:\a
   C:\Directory

In this example, the internal MD command treats the use of the space character differently depending on the command interpreter used. Command.com in Windows 95 does not allow the spaces, while Cmd.exe in Windows NT treats the spaces as delimiters and processes the command by treating each word after the command as a separate parameter.

Note that in each case, the interpreter does not create a long file name or long folder name that includes spaces without the use of quotation marks. To create a long folder name with spaces at a command prompt, use quotation marks as in the following example:

   c:\>md "This is a Directory"

In this case, both operating systems create one folder with the long file name "This is a Directory."

For additional information, see the following article in the Microsoft Knowledge Base:

    ARTICLE-ID: Q155262
    TITLE     : Errors Changing Directory at Command Prompt

REFERENCES

Microsoft Windows NT System Guide, version 3.5.


Additional query words: 3.50 4.00 ldn lfn ms-dos
Keywords : NTSrvWkst
Version : 3.5 3.51 4.0 95
Platform : WINDOWS
Issue type : kbref


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: April 11, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.