Environment Variable Trailing Spaces Not Truncated

Article translations Article translations
Article ID: 36605 - View products that this article applies to.
This article was previously published under Q36605
This article has been archived. It is offered "as is" and will no longer be updated.
Expand all | Collapse all

SUMMARY

When setting environment variables, the following commands produce different environment variables:
SET FIRST=one
SET FIRST =two

MORE INFORMATION

The command SET now displays the following (along with all the other environment variables):
FIRST=one
FIRST =two
Trailing spaces are not removed from the environment variable that is being set. The variables are fully functional and may be addressed in batch files by using the same syntax when referring to the variable. For example, the following line
echo %FIRST %
will print the word "two" on the screen.

Properties

Article ID: 36605 - Last Review: August 23, 2013 - Revision: 2.0
APPLIES TO
  • Microsoft MS-DOS 3.1
  • Microsoft MS-DOS 3.2 Standard Edition
  • Microsoft MS-DOS 3.21 Standard Edition
  • Microsoft MS-DOS 3.3 Standard Edition
  • Microsoft MS-DOS 3.3a
  • Microsoft MS-DOS 4.0 Standard Edition
  • Microsoft MS-DOS 4.01 Standard Edition
  • Microsoft MS-DOS 5.0 Standard Edition
  • Microsoft MS-DOS 5.0a
  • Microsoft MS-DOS 6.0 Standard Edition
  • Microsoft MS-DOS 6.2 Standard Edition
  • Microsoft MS-DOS 6.21 Standard Edition
  • Microsoft MS-DOS 6.22 Standard Edition
Keywords: 
kbnosurvey kbarchive KB36605

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