![]() |
|
|
|||||||
![]() |
Python - Re: c.Win32_OperatingSystem question. |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
oh I noticed the problem with the
BuildNumber = et.SubElement(oper.BuildNumber) instead of BuildNumber = str(oper.BuildNumber) and fixed it. No improvement in results however. Best Regards, Bryan Rasmussen On Sat, Feb 28, 2009 at 6:38 PM, bryan rasmussen <> wrote: > Maybe there's a more specific list I should ask this question on but I > don't know what it is. I'm using Tim Golden's wmi stuff, and putting > my output into an XML document. > > I have the following bit of code > > > Â*root = et.Element("locations") > Â* Â* Â* Â*ComputerInfo = et.SubElement(root, "ComputerInfo") > Â* Â* Â* Â*ComputerName = et.SubElement(ComputerInfo,"ComputerName") > Â* Â* Â* Â*ComputerDomain = et.SubElement(ComputerInfo,"Domain") > > Â* Â* Â* Â*location = et.SubElement(root, "location") > Â* Â* Â* Â*locationpath = et.SubElement(location, "locationpath") > Â* Â* Â* Â*locationtype = et.SubElement(location, "locationtype") > Â* Â* Â* Â*currenttime = et.SubElement(location,"time") > > Â* Â* Â* Â*currenttimeZone = et.SubElement(ComputerInfo,"timeZone") > Â* Â* Â* Â*BootDevice = et.SubElement(ComputerInfo,"BootDevice") > Â* Â* Â* Â*BuildNumber = et.SubElement(ComputerInfo,"BuildNumber") > Â* Â* Â* Â*BuildType = et.SubElement(ComputerInfo,"BuildType") > Â* Â* Â* Â*Caption = et.SubElement(ComputerInfo,"Caption") > Â* Â* Â* Â*CodeSet = et.SubElement(ComputerInfo,"CodeSet") > Â* Â* Â* Â*CountryCode = et.SubElement(ComputerInfo,"CountryCode") > Â* Â* Â* Â*Description = et.SubElement(ComputerInfo,"ComputerDescription") > Â* Â* Â* Â*FreePhysicalMemory = et.SubElement(ComputerInfo,"FreeMemory") > Â* Â* Â* Â*LocalDateTime = et.SubElement(ComputerInfo,"LocalDateTime") > Â* Â* Â* Â*Locale = et.SubElement(ComputerInfo,"Locale") > Â* Â* Â* Â*Manufacturer = et.SubElement(ComputerInfo,"Manufacturer") > Â* Â* Â* Â*Organization = et.SubElement(ComputerInfo,"ComputerOrganization") > > > Â* Â* Â* Â*OSType = et.SubElement(ComputerInfo,"OperatingSystem") > Â* Â* Â* Â*WindowsDirectory = et.SubElement(ComputerInfo,"WindowsDirectory") > > Â* Â* Â* Â*# print Â*"ok" > Â* Â* Â* Â*# time.sleep(3) > > > Â* Â* Â* Â*for oper in c.Win32_OperatingSystem(): > Â* Â* Â* Â* Â*# print "here" > Â* Â* Â* Â* Â*# time.sleep(3) > Â* Â* Â* Â* Â*ComputerName.text = str(oper.Name) > Â* Â* Â* Â* Â*ComputerDomain.text = str(oper.Domain) > Â* Â* Â* Â* Â*currenttimeZone.text = str(oper.CurrentTimeZone) > Â* Â* Â* Â* Â*try: > Â* Â* Â* Â* Â* Â*currenttime.text = str(datetime.datetime.utcnow()) > Â* Â* Â* Â* Â* Â*BootDevice.text = str(oper.BootDevice) > Â* Â* Â* Â* Â* Â*BuildNumber = et.SubElement(oper.BuildNumber) > Â* Â* Â* Â* Â* Â*BuildType.text = str(oper.BuildType) > Â* Â* Â* Â* Â* Â*Caption.text = str(oper.Caption) > Â* Â* Â* Â* Â* Â*CodeSet.text = str(oper.CodeSet) > Â* Â* Â* Â* Â* Â*CountryCode.text = str(oper.CountryCode) > Â* Â* Â* Â* Â* Â*Description.text = str(oper.ComputerDescription) > Â* Â* Â* Â* Â* Â*FreePhysicalMemory.text = str(oper.FreeMemory) > Â* Â* Â* Â* Â* Â*LocalDateTime.text = str(oper.LocalDateTime) > Â* Â* Â* Â* Â* Â*Locale.text = str(oper.Locale) > Â* Â* Â* Â* Â* Â*Manufacturer.text = str(oper.Manufacturer) > Â* Â* Â* Â* Â* Â*Organization.text = str(oper.ComputerOrganization) > > > Â* Â* Â* Â* Â* Â*OSType.text = str(oper.OperatingSystem) > Â* Â* Â* Â* Â* Â*WindowsDirectory.text = str(oper.WindowsDirectory) > > > At the end of that thhe only text node thaht comes out is > ComputerName, WMI is running - Am I using the wrong names for things > here? When I try to get the same values using WScript and WQL to > extract from Win32_OperatingSystem I get all the values. > > Best Regards, > Bryan Rasmussen > bryan rasmussen |
|
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Re: Dial-up Modem Question | w_tom | A+ Certification | 0 | 09-18-2005 09:12 PM |
| "Installing two drives" question - what next? | Jim | A+ Certification | 12 | 08-07-2005 01:19 PM |
| Re: Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good | God | DVD Video | 3 | 04-25-2005 04:19 PM |
| Re: Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good | Filthy Mcnasty | DVD Video | 0 | 04-25-2005 04:29 AM |
| Re: Safe Mode Question (A+ question) | Gordon Findlay | A+ Certification | 0 | 06-16-2004 10:48 AM |