Forum: Ruby How to evaluate VBscript in Ruby 2.0.0 under Windows 7

Abdb670e1c130f96f947a94d03c02efa?d=identicon&s=25 Eric Christopherson (echristopherson)
on 2013-06-03 21:19
(Received via mailing list)
I've run into a little more pain running my existing scripts using Ruby
2.0.0 on Windows 7. This time, I'm trying to run a script that creates
and
uses a WIN32OLE ScriptControl in order to run a VBscript script.

It was working fine under 32-bit Windows XP and Ruby 1.9.3, but now when
I
run the line

    sc = WIN32OLE.new( "ScriptControl" )

I get:

    WIN32OLERuntimeError: failed to create WIN32OLE object from
`ScriptControl'

Is there a new way to run VBscript in Ruby 2.0.0 and/or Windows 7? Is it
necessary to register components from the Windows side or something? If
it
matters, this machine also has Visual Studio 2010, which my old one did
not.
666b4e17b4bb0e2d999037a25f65a7cb?d=identicon&s=25 Heesob Park (phasis)
on 2013-06-04 03:08
(Received via mailing list)
Hi,

2013/6/4 Eric Christopherson <echristopherson@gmail.com>:
>
>     WIN32OLERuntimeError: failed to create WIN32OLE object from
> `ScriptControl'
>
> Is there a new way to run VBscript in Ruby 2.0.0 and/or Windows 7? Is it
> necessary to register components from the Windows side or something? If it
> matters, this machine also has Visual Studio 2010, which my old one did not.

This is not Ruby 2.0.0 vs Ruby 1.9.3 issue, but 64 bit vs 32 bit issue.
The msscript component was not ported to 64 bit. It's a legacy
component and MS chose not to put the effort into migrating it to 64
bit.

If you want to use ScriptControl, you should use 32 bit Ruby
2.0.0(http://rubyforge.org/frs/download.php/76955/rubyin...)

Regards,
Park Heesob
Abdb670e1c130f96f947a94d03c02efa?d=identicon&s=25 Eric Christopherson (echristopherson)
on 2013-06-04 14:50
(Received via mailing list)
On Jun 3, 2013 8:08 PM, "Heesob Park" <phasis@gmail.com> wrote:
>
> Hi,
>
> 2013/6/4 Eric Christopherson <echristopherson@gmail.com>:
> > I've run into a little more pain running my existing scripts using Ruby
> > 2.0.0 on Windows 7. This time, I'm trying to run a script that creates
and
> > uses a WIN32OLE ScriptControl in order to run a VBscript script.
> >
> > It was working fine under 32-bit Windows XP and Ruby 1.9.3, but now
when I
> > necessary to register components from the Windows side or something? If
it
> > matters, this machine also has Visual Studio 2010, which my old one did
not.
>
> This is not Ruby 2.0.0 vs Ruby 1.9.3 issue, but 64 bit vs 32 bit issue.
> The msscript component was not ported to 64 bit. It's a legacy
> component and MS chose not to put the effort into migrating it to 64
> bit.

Thanks, Heesob. Is there a newer, supported way of doing the same thing?

>
> If you want to use ScriptControl, you should use 32 bit Ruby
> 2.0.0(
http://rubyforge.org/frs/download.php/76955/rubyin...)

I've had to do that anyway, for Nokogiri.
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.