Microsoft KB Archive/40549

= QB.EXE May Overwrite File Allocation Table If Floppy Switched =

Article ID: 40549

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

-



This article was previously published under Q40549



SYMPTOMS
QB.EXE can damage a floppy disk's File Allocation Table (FAT) if the following steps occur:


 * 1) A program OPENs a disk file.
 * 2) The disk file is aborted with CTRL+BREAK before the file is ever closed.
 * 3) The floppy running QB.EXE is replaced with a different floppy disk.
 * 4) You exit QB.EXE.



STATUS
Microsoft has confirmed this to be a bug in QuickBasic Versions 4.00, 4.00b, and 4.50 and in the QB.EXE program that is shipped with the Microsoft Basic Compiler Versions 6.00 and 6.00b for MS-DOS and MS OS/2. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.



MORE INFORMATION
The program example shown below will cause QB.EXE to overwrite the File Allocation Table after the following steps are executed:


 * 1) QB.EXE is executed from a floppy disk.
 * 2) The program is started and then interrupted with a CTRL+BREAK.
 * 3) A different disk is put into the drive from which QB.EXE was executed.
 * 4) The QuickBasic QB.EXE editor is exited (such as with ALT+F+X).

The overwrite may occur whether the file is opened with RANDOM access or SEQUENTIAL access.

To work around the problem, do one of the following after breaking out of the program:


 * 1) Go to the immediate window and issue the command CLOSE.
 * 2) Exit QuickBasic before switching disks.

This program does not cause any problem with versions of Microsoft QuickBasic earlier than Version 4.00.

The following is a code example: OPEN &quot;test.dat&quot; FOR OUTPUT AS #1 FOR i = 1 TO 10000 PRINT #1, i NEXT

Additional query words: QuickBas BasicCom buglist4.00 buglist4.00b buglist4.50

Keywords: KB40549

-

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

© Microsoft Corporation. All rights reserved.