Qbasicnews.com

Full Version: SHELL TO DOS
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I understand MS may abandon access to DOS in some future version of Windows. I am wondering is the following, which compiles OK with the DOS version of FB, will solve the problem !! Gordon

Code:
COLOR 12
PRINT " Enter EXIT to return. "
COLOR 7, 0
SHELL ""
no
Read the docs. You can't use SHELL without passing a command.
This will do the job:

[syntax="QBasic"]
COLOR 12
PRINT " Enter EXIT to return. "
COLOR 7, 0
SHELL "%COMSPEC%"
[/syntax]

Wink
COLOR 12
PRINT " Enter EXIT to return. "
COLOR 7, 0
SHELL ""

The above works perfectly on my Win XP Home and Win 98 if compiled with the FB DOS version.

Zydon thanks for your suggestion, allowing us to compile it with the FB Windows version. Below is my suggestion for a COMMAND$ version, that also compiles OK with the Windows version, but it will only accept one COLOR.

Gordon

Code:
PRINT "Enter EXIT to return, and Alt+Enter under DOS"
PRINT "Accepts parameters such as DIR etc."
COLOR 10 : PRINT
IF COMMAND$ ="" THEN SHELL "%COMSPEC%" ELSE SHELL COMMAND$
Yeah, the SHELL "" should work, even in pure Win32, but the problem that you're trying to solve won't be solved by this - the real problem is that future Windows versions probably won't allow DOS programs to run at all. 16-bit code support will go away soon, especially on 64-bit processors, which already have to run 32-bit code in a special compatability mode.
Quote:the real problem is that future Windows versions probably won't allow DOS programs to run at all. 16-bit code support will go away soon, especially on 64-bit processors, which already have to run 32-bit code in a special compatability mode.

And the at the same un-certain future too, there will be many DOS emulators created by DOS fans. Even there got DOS emulator in MAC OS, I guess there is no dead-end for DOS lovers. It would be more surprise if there is DOS 64bit will be created from open-source community such as FreeDOS.
Thank goodness DOS will not be allowed to die. I keep an old HP 486 running by me to play all the old DOS games. Trouble is the CMOS is all in German I cannot speak, and it would not recognise a CD drive I tried instead of one of the Hard Drives. Gordon S.