Stupid WSH QBasic Tricks 
Author Message
 Stupid WSH QBasic Tricks

Here's a long-anticipated method for reviving those elderly QBasic programs you
still have around.

Note that this runs QB hidden, so they can't be interactive; they have to send
output to StdOut.

Also, a peculiarity which I believe is fundamental to QB - it doesn't "do" long
paths.  You will need to pass a short path to it.  On the bright side, should
you need to specify any command line options for QB, you can just stick it into
the "filarg" argument as part of the string which specifies the BAS file....

WScript.Echo QBasic("C:\temp\someprog.bas")

Function QBasic(filarg)
 ' Wrapper for running QuickBasic programs
 ' QB File MUST have last line: SYSTEM
 Dim Sh, FSO, fOut, OutF, Cmd
 Set Sh = createobject("WScript.Shell")
 Set FSO = createobject("Scripting.FileSystemObject")
 fOut = FSO.GetTempName
 Cmd = "%COMSPEC% /c qb /run " & filarg _
  & " 2>NUL 1>" & fOut
  wscript.echo Cmd
  Wscript.Quit
 Sh.Run Cmd, 0, True
 If FSO.FileExists(fOut) Then
  If FSO.GetFile(fOut).Size>0 Then
   Set OutF = FSO.OpenTextFile(fOut)
   QBasic = OutF.Readall
  OutF.Close
  End If
  FSO.DeleteFile(fOut)
 End If
End Function



Tue, 14 Dec 2004 03:36:29 GMT  
 Stupid WSH QBasic Tricks
Where do you find qb though?  It's long gone off my systems.



Quote:
> Here's a long-anticipated method for reviving those elderly QBasic
programs you
> still have around.

<SNIP>
Quote:
>  Cmd = "%COMSPEC% /c qb /run " & filarg _

</SNIP>


Tue, 14 Dec 2004 04:28:27 GMT  
 Stupid WSH QBasic Tricks
It's usually in an "unsupported" or "extras" folder on OS CDs - on Win9x ones
for sure.

While you're going through your old CDs, you might as well grab the NT4 Telnet
and Winfile, too.  They both run on 2000/XP, and Winfile just _screams_ along.


Quote:
> Where do you find qb though?  It's long gone off my systems.



> > Here's a long-anticipated method for reviving those elderly QBasic
> programs you
> > still have around.

> <SNIP>
> >  Cmd = "%COMSPEC% /c qb /run " & filarg _
> </SNIP>



Tue, 14 Dec 2004 04:37:52 GMT  
 Stupid WSH QBasic Tricks
I'll have to have a look around.  I did keep telnet already since I do a lot
of direct-to-the-serial-port type stuff.
And good ol' Cardfile too, mainly because I'm too lazy to write the code to
convert my 300-odd existing cards to something else.  Apparently setting up
a generic/text-only printer that outputs to a file is a quick start for this
but I figure it's easier to just copy over the 93K exe and run wowexec at
system startup (speeds load times).



Quote:
> It's usually in an "unsupported" or "extras" folder on OS CDs - on Win9x
ones
> for sure.

> While you're going through your old CDs, you might as well grab the NT4
Telnet
> and Winfile, too.  They both run on 2000/XP, and Winfile just _screams_
along.



> > Where do you find qb though?  It's long gone off my systems.



Tue, 14 Dec 2004 04:49:13 GMT  
 Stupid WSH QBasic Tricks
Here's what I would LOVE to see.

(1) Winfile with a context menu and drag-to-copy.

(2) A new cardfile that just does the same thing in32-bit.  It worked, let's
keep it!

By the way, if you ever use the Shift+F10 trick to open a command prompt during
a Win2k/XP/.NET install when you have problems, you can start up Winfile and get
a GUI for file manipulation.  As soon as you're out of text mode, it works.


Quote:
> I'll have to have a look around.  I did keep telnet already since I do a lot
> of direct-to-the-serial-port type stuff.
> And good ol' Cardfile too, mainly because I'm too lazy to write the code to
> convert my 300-odd existing cards to something else.  Apparently setting up
> a generic/text-only printer that outputs to a file is a quick start for this
> but I figure it's easier to just copy over the 93K exe and run wowexec at
> system startup (speeds load times).



> > It's usually in an "unsupported" or "extras" folder on OS CDs - on Win9x
> ones
> > for sure.

> > While you're going through your old CDs, you might as well grab the NT4
> Telnet
> > and Winfile, too.  They both run on 2000/XP, and Winfile just _screams_
> along.



> > > Where do you find qb though?  It's long gone off my systems.



Tue, 14 Dec 2004 05:43:14 GMT  
 Stupid WSH QBasic Tricks



<SNIP>

Quote:
> (2) A new cardfile that just does the same thing in32-bit.  It worked,
let's
> keep it!

I found this, but can't get it to import my old (16-bit version) cardfiles.
http://www.aristotle.net/~crazybob/design.htm#cardfile32

Quote:

> By the way, if you ever use the Shift+F10 trick to open a command prompt
during
> a Win2k/XP/.NET install when you have problems, you can start up Winfile
and get
> a GUI for file manipulation.  As soon as you're out of text mode, it
works.

Kewl.  I did not know this one but will definitely keep it in my bag o'
tricks from now on.


Tue, 14 Dec 2004 06:11:57 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Stupid EPS tricks: surviving restore(s) with showpage definition?

2. Stupid LaserWriter Tricks

3. Stupid Stupid Question

4. Stupid question: Where can I get(download) WSH?

5. Logon scripts, WSH, Win95, stupid question??

6. Tricks with Access db

7. Postscript tricks

8. Dumb IE4 tricks: Ever-Changing Title

9. Dumb IE4 tricks: Ever-Changing Title

10. Freehand: Using userprep file to add customized PostScript tricks

11. Is there a trick to...

12. neat trick

 

 
Powered by phpBB® Forum Software