You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
require 'win32ole'
locator = WIN32OLE.new('WbemScripting.SWbemLocator')
service = locator.connectServer("./", "", "", "")
list = service.execQuery("ASSOCIATORS OF {Win32_LogicalDisk='C:'}")
# puts list.ole_get_methods
list.each do |item|
puts item.Caption
end
The snippet crashes with the following exception.
EnumVariant.java:-2:in `Next': org.racob.com.ComFailException: IEnumVARIANT::Net
from EnumVariant.java:47:in `hasMoreElements'
from RubyWIN32OLE.java:64:in `each'
from MethodHandle.java:636:in `invokeWithArguments'
from InvocationLinker.java:232:in `invocationFallback'
from playme.rb:7:in `__file__'
from playme.rb:-1:in `load'
from Ruby.java:811:in `runScript'
from Ruby.java:804:in `runScript'
from Ruby.java:673:in `runNormally'
from Ruby.java:522:in `runFromMain'
from Main.java:395:in `doRunFromMain'
from Main.java:290:in `internalRun'
from Main.java:217:in `run'
from Main.java:197:in `main'
Operating systems: Windows 7 Professional and/or Windows Server 2008 R2, both 64bit
Do you have any idea why this happens? Is the usage wrong or is this an issue with the gem? An explanatory comment or workaround would be great and a huge help.
Thanks
The text was updated successfully, but these errors were encountered:
Hi,
when calling the example snippet
The snippet crashes with the following exception.
The query should be valid according to http://msdn.microsoft.com/en-us/library/aa384793(v=vs.85).aspx
Used versions:
Do you have any idea why this happens? Is the usage wrong or is this an issue with the gem? An explanatory comment or workaround would be great and a huge help.
Thanks
The text was updated successfully, but these errors were encountered: