After a big fight with vbs, I finally made it:
alias getmethod {
.comopen getmethod MSScriptControl.ScriptControl
if (!$comerr) {
var -s %v $&
strComputer = "." $lf $&
strNameSpace = "root\cimv2" $lf $&
strClass = $qt($1) $lf $&
Set objClass = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\" & strNameSpace & ":" & strClass) $lf $&
Set objFSO=CreateObject("Scripting.FileSystemObject") $lf $&
Set objFile = objFSO.CreateTextFile( $qt($mircdirtempcom) ) $lf $&
For Each objClassProperty In objClass.Properties_ $lf $&
objFile.Write objClassProperty.Name & " " $lf $&
Next $lf $&
objFile.Close
noop $com(getmethod,Language,4,bstr,VBScript)
if (!$comerr) noop $com(getmethod,ExecuteStatement,1,bstr,%v)
if (!$comerr) {
.comclose getmethod
var %r $read(tempcom,tn,1)
.remove tempcom
return %r
}
}
:error
if ($error) reseterror
if ($com(getmethod)) .comclose getmethod
}
//echo -a > $getmethod(Win32_OperatingSystem)
> BootDevice BuildNumber BuildType Caption CodeSet CountryCode CreationClassName CSCreationClassName CSDVersion CSName CurrentTimeZone DataExecutionPrevention_32BitApplications DataExecutionPrevention_Available DataExecutionPrevention_Drivers DataExecutionPrevention_SupportPolicy Debug Description Distributed EncryptionLevel ForegroundApplicationBoost FreePhysicalMemory FreeSpaceInPagingFiles FreeVirtualMemory InstallDate LargeSystemCache LastBootUpTime LocalDateTime Locale Manufacturer MaxNumberOfProcesses MaxProcessMemorySize MUILanguages Name NumberOfLicensedUsers NumberOfProcesses NumberOfUsers OperatingSystemSKU Organization OSArchitecture OSLanguage OSProductSuite OSType OtherTypeDescription PAEEnabled PlusProductID PlusVersionNumber Primary ProductType RegisteredUser SerialNumber ServicePackMajorVersion ServicePackMinorVersion SizeStoredInPagingFiles Status SuiteMask SystemDevice SystemDirectory SystemDrive TotalSwapSpaceSize TotalVirtualMemorySize TotalVisibleMemorySize Version WindowsDirectory
Note that I worded everything in the script as though it was grabbing methods, but this is for the properties. If anyone want to get the method, just change objClass.Properties_ to objClass.Methods_
Edit: in my previous post I said it would be using the shell, I mixed things up there.