SHELL "CHDIR", "Input Path for Run-Time Module" if No BC /O (65550)



The information in this article applies to:

  • Microsoft Basic Professional Development System for MS-DOS 7.0
  • Microsoft Basic Professional Development System for MS-DOS 7.1
  • 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

This article was previously published under Q65550

SYMPTOMS

A SHELL statement that changes the current directory or drive (using the MS-DOS CHDIR command) will display the following message when returning control to the Basic program if the program is compiled to require the Basic run-time module (compiled without BC /O):
Input path for run-time module brt7nxxx.EXE [or brun4n.EXE, or brun6nxx.EXE]
This problem occurs only when you run the .EXE from its own directory, and the Basic run-time module is also in that current directory. The problem does not occur if the .EXE or the run-time module is in a non-current directory (that is along the MS-DOS PATH).

STATUS

Microsoft has confirmed this to be a bug in Microsoft Basic Professional Development System (PDS) versions 7.0 and 7.1 for MS-DOS; Microsoft QuickBasic versions 4.0, 4.0b, and 4.5 (buglist4.00, buglist4.00b, buglist4.50) for MS-DOS; and Microsoft Basic Compiler versions 6.0 and 6.0b (buglist6.00, buglist6.00b) for MS-DOS. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

This problem does not occur in an OS/2 protected-mode program (in Basic versions 6.0, 6.0b, 7.0, or 7.1).

MORE INFORMATION

Any one of the following methods can be used to work around this problem:

  • Use the Basic statement CHDIR instead of SHELL "CHDIR ...", or use the Basic statement CHDRIVE instead of SHELL "D:". CHDRIVE is available in Microsoft Basic PDS version 7.1; however, it is not available in Microsoft QuickBasic version 4.5 for MS-DOS.
  • Create a stand-alone (BC /O) .EXE file.
  • Run your compiled .EXE while a different directory is the current directory. For example, if your PROG.EXE program is in the directory C:\DIR1, then log on to any other directory and run C:\DIR1\PROG or take advantage of the DOS PATH to find PROG.EXE. (This problem occurs only when the current directory is the same directory as where both the PROG.EXE program and the Basic run-time module are located.)

Code Example

The code example below duplicates the problem. Compile as follows:
   BC TEST.BAS;
   LINK TEST;
				
To duplicate the problem, put both the TEST.EXE program and the Basic run-time module (BRT7nxxx.EXE or BRUN4n.EXE or BRUN6nxx.EXE) into a subdirectory, make that subdirectory the current directory, then run TEST.EXE.
   ' TEST.BAS
   SHELL "CHDIR \"
   PRINT "TEST"
				

Modification Type:MinorLast Reviewed:8/16/2005
Keywords:KB65550