Microsoft KB Archive/74864

= MKDIR Incorrectly Allows Blanks in Pathname in VB for MS-DOS =

Article ID: 74864

Article Last Modified on 8/16/2005

-

APPLIES TO


 * Microsoft Visual Basic for MS-DOS
 * Microsoft BASIC Professional Development System 7.0
 * Microsoft BASIC Professional Development System 7.1

-



This article was previously published under Q74864



SYMPTOMS
The MKDIR statement in Microsoft Visual Basic for MS-DOS, and Microsoft Basic Professional Development System (PDS) for MS-DOS incorrectly allows the creation of a directory with a blank space in it. When you try to change to that directory from the MS-DOS prompt, MS-DOS generates the error &quot;too many parameters.&quot;



STATUS
Microsoft has confirmed this to be a bug in the Standard and Professional Editions of Microsoft Visual Basic for MS-DOS, version 1.0; and Microsoft Basic Professional Development System (PDS) for MS-DOS, versions 7.0 and 7.1 (buglist7.00 buglist7.10). Microsoft is researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.



MORE INFORMATION
The syntax for the MKDIR statement is as follows:

MKDIR pathname$

where &quot;pathname$&quot; is the string variable containing the path specification and directory name to make.

In Visual Basic for MS-DOS and Basic PDS for MS-DOS, the MKDIR statement incorrectly allows the pathname$ to contain a blank or space character. From within the program, you can use the CHDIR statement to change to that directory. However, at the MS-DOS prompt, you cannot change to that directory because of the blank space.

The following steps reproduce the problem:   Compile the following program: REM Program name: MAKEDIR.BAS MKDIR &quot;C:\test tmp&quot;   Compile as follows: BC MAKEDIR.BAS; LINK MAKEDIR.BAS;  Run the program by typing MAKEDIR at the MS-DOS prompt to create the directory. At the &quot;C:\&quot; prompt, type the following command to try to change to the &quot;test tmp&quot; directory:

cd test tmp



MS-DOS returns the error &quot;Too many parameters - tmp&quot;. You can remove this directory with the RMDIR statement. The following statement will remove the directory created in the previous program:

RMDIR &quot;test tmp&quot;

The MKDIR function correctly gives the error &quot;Path Not Found&quot; when other illegal MS-DOS characters such as the '?' and '*' are entered in as the pathname$.

Additional query words: VBmsdos buglist1.00 7.00 7.10 1.00

Keywords: KB74864

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.