From: timgerrlists Date: 2005-11-22T03:32:23+09:00 Subject: Re: Ruby and WMI Dave Burt wrote: > timgerrlists wrote: > > Dave thank you for the informaiton but I am getting some errors, " > > Untitled2.rb:2: undefined local variable or method `cpuName' for > > main:Object (NameError)" Not sure what to do here. > > You haven't defined cpuName. If you post the script you're using, I can be > more specific. The following script should work just like the VBScript you > posted. (You might notice it also looks very similar.) > > require 'win32ole' > strComputer = "localhost" > objGroup = WIN32OLE.connect("WinNT://#{strComputer}/Administrators,group") > for mem in objGroup.Members > puts "\t" + mem.adsPath[8..-1] > end > > Cheers, > Dave Thank you, it now works, can you tell me one thing, ( I am learning) what does [8..-1] mean in the script "puts "\t" + mem.adsPath[8..-1]". Thanks again.