Welcome to Pete's QBASIC Site!


FreeBasic Top 50

QB Top 50

QB FAQ
What DOS switches are available when running QBASIC?

QBASIC has several DOS switches that will adjust how your QBASIC programming environment will operate. These are activated by typing "QBASIC" in DOS followed by the appropriate switch. (If you are running QB from within Windows, you will first have to navigate to the same directory as QBASIC before operating these switches.)

The following switches are available and built into QB:
QBASIC [/B] [/EDITOR] [/G] [/H] [/MBF] [/NOHI] [[/RUN] [drive:][path]filename]

And here's what they mean:
/BAllows use of a monochrome monitor with a color graphics card.
/EDITORStarts the MS-DOS Text Editor. (You can use QBASIC to edit standard ASCII text files.)
/GProvides the fastest update of a CGA screen.
/HDisplays the maximum number of lines possible for your hardware.
/MBFConverts the built-in functions MKS$, MKD$, CVS, and CVD to MKSMBF$, MKDMBF$, CVSMBF, and CVDMBF, respectively.
/NOHIAllows the use of a monitor without high-intensity support.
/RUNRuns the specified Basic program before displaying it.
[[drive:][path]filename] Specifies the program file to load or run.

The most useful of these commands is the last one in the table, /RUN. This allows you to automatically start running your program as soon as QBASIC loads, without having to go through the QBASIC IDE first. Also, if you create a *.BAT file containing the /RUN command, you can automatically run your program without having to type the command each time. With this trick, you can achieve the illusion of a compiled program.

Submitted by: Pete on June 24, 2004

Return to the FAQ


Copyright Pete's QBASIC / QuickBasic Site, 1998-2013.
All rights reserved. Site owned and operated by Pete Berg. Programs and submitted content are property of their creators, and appear on this site by direct or implied permission. Pete's QBasic Site is powered by Coranto. This site was created entirely in Notepad.