Howdy, Stranger!

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

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Opening Windows XP

unforgetablegaunforgetablega Posts: 5Member
I was a bit upset that Qbasic would only see the old dos filenames as the 8.3 format. So if I tried to produce a list of filenames I only got them cryptic names. And if I went into CMD then I had to EXIT out to get back to basic. I found that CMD has an option that will run CMD and the program (programname) called and exit by itself.
That command is CMD /C programname
So one can create a batch file, run it with SHELL "CMD /C whatever.bat" and then view "whatever's" output..


Comments

  • KDivad LeahcimKDivad Leahcim Posts: 3,948Member
    : I was a bit upset that Qbasic would only see the old dos filenames as the 8.3 format. So if I tried to produce a list of filenames I only got them cryptic names. And if I went into CMD then I had to EXIT out to get back to basic. I found that CMD has an option that will run CMD and the program (programname) called and exit by itself.
    : That command is CMD /C programname
    : So one can create a batch file, run it with SHELL "CMD /C whatever.bat" and then view "whatever's" output..
    :
    :
    :

    Or put "Exit" as the last line of the batch file and it should close itself.

    A bit off-topic, but what-the-heck, eh?:

    List of files:

    SHELL "cmd /C dir > temp.txt"

    Or, if you're on 9x:

    SHELL "command /C dir > temp.txt"

    /verbose option for Dir will give you even more information (though not much more). Then load and parse the data. I've done this, it took an amazingly long time to parse (almost .5 seconds for about 20 entries???) though I guess that could have been the time to load the command interpreter.

    Anyway, QBasic should happily call Dir by itself, removing the difference between NT and 9x.
  • unforgetablegaunforgetablega Posts: 5Member
    : : I was a bit upset that Qbasic would only see the old dos filenames as the 8.3 format. So if I tried to produce a list of filenames I only got them cryptic names. And if I went into CMD then I had to EXIT out to get back to basic. I found that CMD has an option that will run CMD and the program (programname) called and exit by itself.
    : : That command is CMD /C programname
    : : So one can create a batch file, run it with SHELL "CMD /C whatever.bat" and then view "whatever's" output..
    : :
    : :
    : :
    :
    : Or put "Exit" as the last line of the batch file and it should close itself.
    :
    : A bit off-topic, but what-the-heck, eh?:
    :
    : List of files:
    :
    : SHELL "cmd /C dir > temp.txt"
    :
    : Or, if you're on 9x:
    :
    : SHELL "command /C dir > temp.txt"
    :
    : /verbose option for Dir will give you even more information (though not much more). Then load and parse the data. I've done this, it took an amazingly long time to parse (almost .5 seconds for about 20 entries???) though I guess that could have been the time to load the command interpreter.
    :
    : Anyway, QBasic should happily call Dir by itself, removing the difference between NT and 9x.
    :


    I also figured that using Exit at the end of the batch file would work, but all that does is Exit to Command from CMD, shell is a call to Command, and CMD is a call within the Command shell, so then one would still have to manually Exit.

    P.S. Where do you see the "verbose" parameter in Dir ?



Sign In or Register to comment.