Difference between revisions of "SHELL"

From QB64 Wiki
Jump to navigation Jump to search
imported>Clippy
(Created page with '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.…')
 
imported>Clippy
Line 7: Line 7:
  
  
* DOS commands can be a mixture of string and string variables added together.
+
* 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.
 
* Allows access to DOS services such as DIR, VER, etc.
 
* Commands can also run Windows programs such as Notepad to read text files.
 
* Commands can also run Windows programs such as Notepad to read text files.

Revision as of 08:38, 30 August 2009

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 Notepad opens.


Example: Shells to open Notepad minimized to print a file in Windows XP.


SHELL "CMD C/ START /Min Notepad /p " + FileName$ ' NT version


SHELL "START /min Notepad /p " + FileName$ ' Win 9x version


See also: FILES, CHDIR, MKDIR, NAME