InterviewSolution
Saved Bookmarks
| 1. |
Solve : Launching a batch file from qbasic? |
|
Answer» 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!!!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. 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$ Won;t work as advertised. Quote from: Geek-9pm on April 10, 2010, 03:35:02 PM Won;t work as advertised. Whatever that means, (?) it worked for us; your task is to work out what you are doing wrong. Quote from: Geek-9pm on April 10, 2010, 03:35:02 PM Won;t work as advertised. Please post QuickBasic and batch scripts which "won't work as advertised" Quote from: Salmon Trout on April 10, 2010, 05:11:21 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? Quote from: Geek-9pm on April 10, 2010, 10:15:38 PM 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: 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. Geek - I would still like to see the QuickBasic and batch script codings which failed for you. |
|