From: Eric Christopherson Date: 2013-06-04T21:49:30+09:00 Subject: Re: How to evaluate VBscript in Ruby 2.0.0 under Windows 7 --001a11c2c4000773cb04de5383d9 Content-Type: text/plain; charset=UTF-8 On Jun 3, 2013 8:08 PM, "Heesob Park" wrote: > > Hi, > > 2013/6/4 Eric Christopherson : > > 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. > > 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/rubyinstaller-2.0.0-p195.exe) I've had to do that anyway, for Nokogiri. --001a11c2c4000773cb04de5383d9 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

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 tha= t creates and
> > uses a WIN32OLE ScriptControl in order to run a VBscript script.<= br> > >
> > It was working fine under 32-bit Windows XP and Ruby 1.9.3, but n= ow when I
> > run the line
> >
> > =C2=A0 =C2=A0 sc =3D WIN32OLE.new( "ScriptControl" ) > >
> > I get:
> >
> > =C2=A0 =C2=A0 WIN32OLERuntimeError: failed to create WIN32OLE obj= ect 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 somethi= ng? If it
> > matters, this machine also has Visual Studio 2010, which my old o= ne 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/rubyinstal= ler-2.0.0-p195.exe)

I've had to do that anyway, for Nokogiri.

--001a11c2c4000773cb04de5383d9--