Microsoft KB Archive/26478

= DOS APPEND Path Can Affect Make EXE File Command in QB/QBX.EXE =

Article ID: 26478

Article Last Modified on 11/21/2006

-

APPLIES TO


 * Microsoft QuickBasic 4.0
 * Microsoft QuickBASIC 4.0b
 * Microsoft QuickBasic 4.5 for MS-DOS
 * Microsoft BASIC Compiler 6.0
 * Microsoft BASIC Compiler 6.0b
 * Microsoft BASIC Professional Development System 7.0
 * Microsoft BASIC Professional Development System 7.1

-



This article was previously published under Q26478



SUMMARY
Using the Make EXE File command (from the Run menu) in the QB.EXE (or QBX.EXE) environment fails to make an .EXE file if BC.EXE or LINK.EXE appears anywhere in the APPEND path, or if the MS-DOS APPEND path points to the directory where QB.EXE (or QBX.EXE) is located and you are running QB.EXE (or QBX.EXE) from a different directory.

This behavior does not occur when you use BC.EXE and LINK.EXE to compile and link a program from the DOS command line.



MORE INFORMATION
The APPEND path is similar to the PATH statement, except it works with data files, not executables. It causes several directories (all those in its path) to appear as a single, large directory to an executing application (in this case, QB or QBX).

Steps to Reproduce Problem

 * 1) Type append c:\dos at the DOS command line. Note: The DOS directory will need to contain LINK.EXE for the link step to fail.
 * 2) From the DOS command line, type qbx prog.bas, where PROG.BAS represents any Basic program.
 * 3) From the QBX or QB Run menu, choose Make EXE File (ALT+R, X).

Compile status information will scroll on the screen, the link command line will appear, the system will pause, and the &quot;Press Any Key to Continue&quot; message will appear at the bottom of the screen. However, the .EXE will not be created.

To cause the compiler to fail when making a .EXE from the development environment, include the path to BC.EXE as part of the APPEND path. From the DOS command line, type append c:\bc7\binb (if using Basic PDS) or append c:\qb45 (if using QuickBasic), assuming BC.EXE is one of these default directories. Follow steps 2 and 3 above to cause the compile step to fail.

Below are several ways to work around the problem:


 * 1) Remove the APPEND TSR by removing the APPEND statement from the AUTOEXEC.BAT file and rebooting the computer.
 * 2) Type append=; at the DOS command line to remove the path used by APPEND. The APPEND TSR will still remain in memory.
 * 3) Do not include the path to BC.EXE or any version of LINK.EXE after the APPEND statement. This can be done by assigning APPEND to a directory path not containing BC.EXE or LINK.EXE.
 * 4) Compile and link the program from the DOS command line (outside of QB.EXE or QBX.EXE) using BC.EXE and LINK.EXE.

Steps to Reproduce Problem
 Put BC.EXE and QB.EXE in a directory called C:\QB. Type the following DOS PATH command:

path=c:\qb

 Type the following DOS command:

append c:\qb

 Log onto the following:

c:\qb\bugs

 Run QB.EXE and load in any simple program to compile. When you attempt to use the Make EXE File command on the Run menu, you shell out to DOS but immediately get a prompt to &quot;Press any key to continue,&quot; and no. EXE file is created. Control is immediately returned to the editor even if you use the Make EXE and EXIT command.</ol>

To work around this problem, put BC.EXE (and LINK.EXE) in a subdirectory other than the one specified by the DOS APPEND command.

Caution when Using DOS APPEND
The DOS APPEND utility (APPEND.COM in DOS version 3.x; APPEND.EXE in DOS 5.0) should be used with caution, because APPEND causes files in the APPEND path to be overwritten when new, nonexistent files of the same name are opened for writing in a different directory.

For example, the following Basic program will overwrite any file called TEST.DOC along the APPEND path if TEST.DOC does not exist in C:\SUBDIR: OPEN &quot;C:\SUBDIR\TEST.DOC&quot; FOR OUTPUT AS #1 PRINT#1,&quot;this overwrites the file&quot; CLOSE Note that if TEST.DOC does not exist anywhere along the APPEND path or in C:\SUBDIR, then TEST.DOC is created in C:\SUBDIR.

This caution note is not a QuickBasic problem; this is how APPEND is designed to work.

Additional query words: QuickBas BasicCom 4.00 4.00b 4.50 6.00 6.00b 7.00 7.10

Keywords: KB26478

-

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

© Microsoft Corporation. All rights reserved.