Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Launching a batch file from qbasic  (Read 8540 times)

0 Members and 1 Guest are viewing this topic.

hugemelmoth

  • Guest
Launching a batch file from qbasic
« on: March 29, 2010, 10:27:15 AM »
Does anybody know the statement to run a batch file from Qbasic? I've been trying with SHELL, or RUN... but none of them worked. I would appreciatte an example!!! (the Qbasic version I'm using is 4.5). Thks in advance!!!

Dusty



    Egghead

  • I could if she would, but she won't so I don't.
  • Thanked: 75
  • Experience: Beginner
  • OS: Windows XP
Re: Launching a batch file from qbasic
« Reply #1 on: March 29, 2010, 02:39:19 PM »
Quote
I've been trying with SHELL, or RUN... but none of them worked.

QuickBasic code:
Code: [Select]
Shell "c:\batfile.bat"
works for me.

One good deed is worth more than a year of good intentions.

Salmon Trout

  • Guest
Re: Launching a batch file from qbasic
« Reply #2 on: March 30, 2010, 01:09:31 AM »
The QB SHELL command requires a string as a parameter. Both these work

Code: [Select]
SHELL "C:\TEST.BAT"

SH$="C:\TEST.BAT"
SHELL SH$

Geek-9pm


    Mastermind
  • Geek After Dark
  • Thanked: 1026
    • Gekk9pm bnlog
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 10
Re: Launching a batch file from qbasic
« Reply #3 on: April 10, 2010, 03:35:02 PM »
Won;t work as advertised.

Salmon Trout

  • Guest
Re: Launching a batch file from qbasic
« Reply #4 on: April 10, 2010, 05:11:21 PM »
Won;t work as advertised.


Whatever that means, (?) it worked for us; your task is to work out what you are doing wrong.

Dusty



    Egghead

  • I could if she would, but she won't so I don't.
  • Thanked: 75
  • Experience: Beginner
  • OS: Windows XP
Re: Launching a batch file from qbasic
« Reply #5 on: April 10, 2010, 08:43:36 PM »
Won;t work as advertised.


Please post QuickBasic and batch scripts which "won't work as advertised"

One good deed is worth more than a year of good intentions.

Geek-9pm


    Mastermind
  • Geek After Dark
  • Thanked: 1026
    • Gekk9pm bnlog
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 10
Re: Launching a batch file from qbasic
« Reply #6 on: April 10, 2010, 10:15:38 PM »
Whatever that means, (?) it worked for us; your task is to work out what you are doing wrong.
Yes, it works for you and maybe me.
However, you could have mentioned that there has to be a valid batch file in the directory specified.
Perhaps a more transparent example would be to use the shell for a directory commands like this:
SHELL "DIR C:*.* /B"
in which should work properly unless he  does not have a  C: drive.

Also there is a version of the Quick Basic that is just simply called QBASIC which I believe was on the Windows 95 CD.  That version of basic will not do some shell commands properly.

Just to make things clear for the newcomers.

Actually, I tried the example you gave and could not understand why it did not work and why it did not give an error message that made sense.

Also, QB does not exit after the SHELL command. Does the OP want QB to quit after the batch files starts?

Salmon Trout

  • Guest
Re: Launching a batch file from qbasic
« Reply #7 on: April 11, 2010, 12:35:47 AM »
However, you could have mentioned that there has to be a valid batch file in the directory specified.

But that is obvious even to a little child. I do not understand why you wrote that. That is so deeply trivial that I wonder at your sanity and common sense. A tip, Geek, when you are in a hole, stop digging!

Quote
Perhaps a more transparent example would be to use the shell for a directory commands like this:
SHELL "DIR C:*.* /B" in which should work properly unless he  does not have a  C: drive.

Again, why did you write that? Are you stoned or something?

Quote
Also there is a version of the Quick Basic that is just simply called QBASIC which I believe was on the Windows 95 CD.  That version of basic will not do some shell commands properly.

Really? Are you sure? How do you know? How can we believe you? Which shell commands? Did you just make that up?

Quote
Just to make things clear for the newcomers.

A laudable target, but one which you have entirely failed to hit.

Quote
Actually, I tried the example you gave and could not understand why it did not work and why it did not give an error message that made sense.

Don't blame us for your comprehension problems.

Quote
Also, QB does not exit after the SHELL command.

Whoever said or implied that it did? WTH are you blathering on about?

Quote
Does the OP want QB to quit after the batch files starts?

I shouldn't think so, otherwise they would have said so.

Dusty



    Egghead

  • I could if she would, but she won't so I don't.
  • Thanked: 75
  • Experience: Beginner
  • OS: Windows XP
Re: Launching a batch file from qbasic
« Reply #8 on: April 11, 2010, 01:44:39 AM »
Geek - I would still like to see the QuickBasic and batch script codings which failed for you.
One good deed is worth more than a year of good intentions.