ruby-wmi icon indicating copy to clipboard operation
ruby-wmi copied to clipboard

How to invoke method of management class?

Open J-F-Liu opened this issue 9 years ago • 1 comments

The following is C# code from MSDN, how to write this in Ruby?

// create a new instance of the Win32_Share WMI object
 ManagementClass cls = new ManagementClass("Win32_Share");

 // set the scope of the new instance to that created above
 cls.Scope = ms;

 // assemble the arguments to be passed to the Create method
 object[] methodargs = { filepath, sharename, "0" };

 // invoke the Create method to create the share
 object result = cls.InvokeMethod("Create", methodargs);

J-F-Liu avatar May 05 '15 03:05 J-F-Liu

I also would be interested in an answer to this question.

mbigatti avatar Mar 23 '16 14:03 mbigatti