Ruby.exe crashing with WIN32OLE WMI example?

Y

yonatan

Hi everyone,

I'm trying to do some WMI stuff with Ruby. I found this simple
example somewhere. It works -- until the program exists that is.
Then Windows pops up a "ruby.exe - Application Error" message box due
to inappropriate memory access.

require 'win32ole'

mgmt = WIN32OLE.connect('winmgmts:\\\\.')
mgmt.InstancesOf("win32_process").each{ |proc|
puts proc.name
}
`pause`

Does anyone know how to solve the problem? I'm running "ruby 1.8.0
(2003-08-04) [i386-mswin32]" on Windows 2000.

Regards,
Yonatan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top