Running DOS commands in Quickbasic

I am just starting out learning more about Quickbasic. I have some background in the language as well as C/C++ and COBOL; so, I am a little familiar with the basics. My question is, Is it possible to run DOS commands within Quickbasic? I know there is the FILES command that is pretty much the same as DIR in DOS. I need to run DIR with switches as well as NDIR for my Novell environment. I want to write the results of the DIR/NDIR to file and extract data from it (i.e. folder names and sizes). Please let me know if this is possible. Thanks.

Comments

  • You can run DOS commands in QBasic using the shell command.

    To do what you want use something like SHELL "Dir > c:dir.txt"

    You may run into some differences between running some commands through SHELL and from the command line. Some combinations of QBasic and some Windows versions causes a separate version of cmd.com to be run. This contains slightly different DOS commands to those in command.com to be run. DIR is an example of this. I use Windows 2000 and the layout of the results of DIR is different when running it through QBasic.

    Ray
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion