Native MS-DOS Commands and the Space Character

Article translations Article translations
Article ID: 166827 - View products that this article applies to.
This article was previously published under Q166827
Expand all | Collapse all

SUMMARY

The Windows operating system uses various command interpreters to process commands at a command prompt, such as 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

Various Windows operating systems may generate different results for the same command when typed at a command prompt. For example, the following command generates different results:
c:\>md This is a Directory
In Windows 95, this command generates the following error message:
Too many parameters - is
In Windows NT-based computers and later, 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 (and later) 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."

REFERENCES

Microsoft Windows NT System Guide, version 3.5.

Properties

Article ID: 166827 - Last Review: February 26, 2007 - Revision: 2.2
APPLIES TO
  • Microsoft Windows 2000 Server
  • Microsoft Windows 2000 Advanced Server
  • Microsoft Windows 2000 Professional Edition
  • Microsoft Windows 2000 Datacenter Server
  • Microsoft Windows NT Server 3.5
  • Microsoft Windows NT Server 3.51
  • Microsoft Windows NT Server 4.0 Standard Edition
  • Microsoft Windows NT Workstation 3.5
  • Microsoft Windows NT Workstation 3.51
  • Microsoft Windows NT Workstation 4.0 Developer Edition
  • Microsoft Windows 95
Keywords: 
KB166827

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com