DOS APPEND Path Can Affect Make EXE File Command in QB/QBX.EXE (26478)



The information in this article applies to:

  • Microsoft QuickBASIC 4.0
  • Microsoft QuickBASIC 4.0b
  • Microsoft QuickBASIC 4.5
  • Microsoft BASIC Compiler for MS-DOS and OS/2 6.0
  • Microsoft BASIC Compiler for MS-DOS and OS/2 6.0b
  • Microsoft Basic Professional Development System (PDS) for MS-DOS and MS OS/2 7.0
  • Microsoft Basic Professional Development System (PDS) for MS-DOS and MS OS/2 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).

Example 1

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 "Press Any Key to Continue" 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.

Example 2

Steps to Reproduce Problem

  1. Put BC.EXE and QB.EXE in a directory called C:\QB.
  2. Type the following DOS PATH command:

    path=c:\qb

  3. Type the following DOS command:

    append c:\qb

  4. Log onto the following:

    c:\qb\bugs

  5. Run QB.EXE and load in any simple program to compile.
  6. 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 "Press any key to continue," and no. EXE file is created. Control is immediately returned to the editor even if you use the Make EXE and EXIT command.
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 "C:\SUBDIR\TEST.DOC" FOR OUTPUT AS #1
   PRINT#1,"this overwrites the file"
   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.

Modification Type:MinorLast Reviewed:1/9/2003
Keywords:KB26478