The SHELL statement allows a program to use DOS commands.
Syntax: SHELL DosCommand$
- DOS commands can be a mixture of string and string variables added together(not case sensitive).
- Allows access to DOS services such as DIR, VER, etc.
- Commands can also run Windows programs such as Notepad to read text files.
- NOTE: Unless QB is in a screen 0 window mode, your program will be minimized when a program opens.
Example: Shells to open Notepad minimized to print a file in Notepad.
SHELL "CMD C/ START /Min Notepad /p " + FileName$ ' NT version
SHELL "START /min Notepad /p " + FileName$ ' Win 9x version
Note: Using a Windows program allows a file to be printed on a USB printer.