KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q22015: SHELL "PATH=\…" Affects Only a Local Copy of DOS

Article: Q22015
Product(s): See article
Version(s): 2.00 2.01 3.00 4.00 4.00b 4.50
Operating System(s): MS-DOS
Keyword(s): ENDUSER | | mspl13_basic
Last Modified: 31-JAN-1990

SHELLing to the DOS PATH command fails to change the default directory
search path when you exit QuickBASIC. BASICA Version 3.10 behaves
similarly.

The following is an example:

   SHELL "PATH=\BASIC"

According to Page 458 of the "Microsoft QuickBASIC Compiler" manual
for Version 3.00 and Page 396 of the "Microsoft QuickBASIC Version
4.0: BASIC Language Reference" manual, the SHELL statement allows
execution of DOS commands such as DIR, PATH, and SORT.

When you invoke a SHELL command from a QuickBASIC program, a local
copy of COMMAND.COM and the DOS environment is spawned. When paths are
changed, only the local environment copy is changed, not the original
DOS environment.

THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Copyright Microsoft Corporation 1986-2002.