WSH 2.0? 
Author Message
 WSH 2.0?

I just downloaded and ran the Scripting Engines 5.1 installer hoping to get
WSH 2.0, but when I look at the references in VB, I only have WSH 1.0.

Am I doing something wrong? Is there something else I need to download?

TIA,

Peter Young



Mon, 23 Dec 2002 03:00:00 GMT  
 WSH 2.0?

The descriptive text in the typelib (embedded in wshom.ocx) is incorrect.  It stills says "Windows
Script Host Object Model (Ver 1.0)" even for the wshom.ocx that has a binary version of 5.1 (WSH
2.0).

The typelib description for wscript.exe is correct - "Windows Script Host (Ver 5.1)"...

--
Michael Harris
MVP Scripting

I just downloaded and ran the Scripting Engines 5.1 installer hoping to get
WSH 2.0, but when I look at the references in VB, I only have WSH 1.0.

Am I doing something wrong? Is there something else I need to download?

TIA,

Peter Young



Mon, 23 Dec 2002 03:00:00 GMT  
 WSH 2.0?

Michael,

I see that you're right.

I was hoping to be able to access stdin and stdout from a VB app, but it
looks like they're only available when running cscript from the command
line. I don't see them in the object browser. :-(

Thanks for the help.

Peter Young


Quote:
> The descriptive text in the typelib (embedded in wshom.ocx) is incorrect.

It stills says "Windows
Quote:
> Script Host Object Model (Ver 1.0)" even for the wshom.ocx that has a

binary version of 5.1 (WSH
Quote:
> 2.0).

> The typelib description for wscript.exe is correct - "Windows Script Host
(Ver 5.1)"...

> --
> Michael Harris
> MVP Scripting



Tue, 24 Dec 2002 03:00:00 GMT  
 WSH 2.0?
Here's a KB article on how to do this with straight API calls:

Q171654 - HOWTO: Attach a Console Window to Your Visual Basic Program
http://support.microsoft.com/support/kb/articles/Q171/6/54.asp

There's also an undocumented (but supported - it was just supposed to be hidden ;-)
GetStandardStream method (FSO).

Jeff Mastry posted the following VB6 example earlier this year (February) that uses
GetStandardStream()...

Private Sub Form_Load()
    If AllocConsole() Then
      hConsole = GetStdHandle(STD_OUTPUT_HANDLE)
      If hConsole = 0 Then MsgBox "Couldn't allocate STDOUT"

      Dim fso As New FileSystemObject
      Dim out As TextStream
      Set out = fso.GetStandardStream(1)
      out.Write "This is a test!" & vbCrLf
      out.Close

    Else
      MsgBox "Couldn't allocate console"
    End If
  End Sub

--
Michael Harris
MVP Scripting


Michael,

I see that you're right.

I was hoping to be able to access stdin and stdout from a VB app, but it
looks like they're only available when running cscript from the command
line. I don't see them in the object browser. :-(

Thanks for the help.

Peter Young


Quote:
> The descriptive text in the typelib (embedded in wshom.ocx) is incorrect.

It stills says "Windows
Quote:
> Script Host Object Model (Ver 1.0)" even for the wshom.ocx that has a

binary version of 5.1 (WSH
Quote:
> 2.0).

> The typelib description for wscript.exe is correct - "Windows Script Host
(Ver 5.1)"...

> --
> Michael Harris
> MVP Scripting



Tue, 24 Dec 2002 03:00:00 GMT  
 WSH 2.0?

Michael,

Quote:
> Here's a KB article on how to do this with straight API calls:

> Q171654 - HOWTO: Attach a Console Window to Your Visual Basic Program
> http://support.microsoft.com/support/kb/articles/Q171/6/54.asp

The problem is, you have to create your own unique console. This won't work
from the command prompt.

The only way I've been able to make a VB app that reads/writes to the
console is with L.J.Johnson's technique of modifying the executable after
it's built. That works well, but it's unsupported and you can't debug very
well.

Quote:
> There's also an undocumented (but supported - it was just supposed to be
hidden ;-)
> GetStandardStream method (FSO).

I can see this coming in very handy.

Thanks!!!

-Peter Young



Fri, 27 Dec 2002 03:00:00 GMT  
 WSH 2.0?

Correction,

Quote:
> The only way I've been able to make a VB app that reads/writes to the
> console is with L.J.Johnson's technique of modifying the executable after
> it's built. That works well, but it's unsupported and you can't debug very
> well.

I just realized that you can use editbin.exe to modify a VB executable to
read/write to the command line, so no need to use an unsupported technique.
However, there still is the unfortunate fact that you can't debug it very
cleanly.


Fri, 27 Dec 2002 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. "Broken" WSH 2.0

2. WSH 2.0 and the AddPrinterConnection ?

3. Deploying WSH 2.0

4. SetDefaultPrinter Method and WSH 2.0

5. WSH 2.0 install

6. WSH 2.0 newsletter available

7. Question about WSH 2.0 TypeLibrary support?

8. Is WSH 2.0 installed with IE5.01?

9. WSH 2.0 include

10. What happen with WSF and DEBUG (WSH 2.0 Final Version)

11. How to debug in WSH 2.0

12. ANN: WSH 2.0 will ship tomorrow

 

 
Powered by phpBB® Forum Software