Programming Field

Qbasic - DOS/Command Prompt Reference

[MS-DOS] Launches the MS-DOS QBasic IDE/Interpreter.

* It might be included with Windows 95/98/Me and the Windows NT series, but it is not included with Windows 2000 and later versions.

* This page does not provide explanations of statements, functions, etc., available in QBasic.

Syntax

qbasic [/B] [/EDITOR] [/G] [/H] [/MBF] [/NOHI]
    [[/RUN] <file-name>]

Options

/B Performs screen display in monochrome. However, it does not affect processes that change colors, such as the COLOR statement in QBasic.
/EDITOR Starts the MS-DOS Editor (launched with edit.com).
/G Optimizes screen updates for CGA (Color Graphics Adapter) to achieve maximum speed.
/H Performs screen display using as many lines as possible.
/MBF Converts the functions MKS$, MKD$, CVS, CVD to MKSMBF$, MKDMBF$, CVSMBF, CVDMBF, respectively. Normally, functions like MKS$ and MKSMBF$ handle different formats, but using this option allows them to handle the same format (primarily used to maintain compatibility with BASICA (GW-BASIC) code).
/NOHI Makes it usable even on monitors that do not support high-intensity.
/RUN Executes before displaying the file specified by ‘<file-name>’. If using this option, you need to specify ‘<file-name>’.
<file-name> Specifies the file to open initially. If no file is specified, an empty IDE will be displayed.

Details

About Qbasic command

Using the Qbasic command allows you to launch the development environment of ‘MS-DOS QBasic’, which is a subset of QuickBASIC. In this development environment, you can perform tasks such as using the editor, executing code, debugging, and accessing help.

[Japanese MS-DOS] Qbasic needs to be launched in an English environment. Therefore, you should switch to English mode using Chev or Chcp beforehand, or use Switch to restart the computer in an English environment.

[MS-DOS 6.x or earlier] The text editor ‘edit.com’ (MS-DOS Editor) internally utilizes ‘qbasic.exe’. If you delete ‘qbasic.exe’ for purposes such as freeing up space, ‘edit.com’ may no longer be able to launch.

Executing batch process using Qbasic

Combining the Qbasic command's ‘/RUN’ option with the QBasic statement ‘SYSTEM’ allows you to execute Basic programs like batch processing. For example,

PRINT "Hello, world"
SYSTEM

...if you save this Basic program as ‘hello.bas’ and execute ‘qbasic /RUN hello.bas’, it will output ‘Hello, world’ on the screen, and control will return to the prompt.

Samples

Sample

qbasic /RUN C:\APPS\GAME.BAS

Opens ‘C:\APPS\GAME.BAS’ and executes it immediately.

See also