ruby-wmi
ruby-wmi copied to clipboard
How to invoke method of management class?
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);
I also would be interested in an answer to this question.