RE: Get OS name

Discussion in 'Python' started by Tim Golden, Apr 15, 2005.

  1. Tim Golden

    Tim Golden Guest

    [rbt]
    |
    | codecraig wrote:
    | > How can I get the OS Name, such as "Windows XP Pro". I
    | know I can do
    | >
    | > sys.getwindowsversion but that doesnt return a nice Windows XP Pro
    | > string.
    | >
    | > and os.name gives "nt"
    | >
    | > thanks.
    | >
    |
    | Read the docs... sys.getwindowsversion() should do the trick. AFAIK,
    | there is no way to differentiate between XP Home and Pro...

    I'm no expert on this (I don't even use XP) but the WMI
    Win32_OperatingSystem class seems to give a useful string
    here:

    <code>
    import wmi

    c = wmi.WMI ()
    for os in c.Win32_OperatingSystem ():
    print os.Caption

    </code>

    gives "Microsoft Windows XP Professional" and
    "Microsoft Windows 2000 Professional" on a couple
    of machines I tried.

    TJG

    ________________________________________________________________________
    This e-mail has been scanned for all viruses by Star. The
    service is powered by MessageLabs. For more information on a proactive
    anti-virus service working around the clock, around the globe, visit:
    http://www.star.net.uk
    ________________________________________________________________________
     
    Tim Golden, Apr 15, 2005
    #1
    1. Advertising

  2. Tim Golden

    codecraig Guest

    where can I get wmi module, it doesnt come with Python right?

    thanks.
     
    codecraig, Apr 15, 2005
    #2
    1. Advertising

  3. On 2005-04-15, codecraig <> wrote:

    > where can I get wmi module, it doesnt come with Python right?


    http://www.google.com/search?q=python wmi module

    --
    Grant Edwards grante Yow! ... I want a COLOR
    at T.V. and a VIBRATING BED!!!
    visi.com
     
    Grant Edwards, Apr 15, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?iso-8859-1?B?bW9vcJk=?=
    Replies:
    7
    Views:
    890
    Roedy Green
    Jan 2, 2006
  2. ding feng
    Replies:
    2
    Views:
    2,904
    ding feng
    Jun 25, 2003
  3. Bobby Chamness
    Replies:
    2
    Views:
    2,440
    Joe Smith
    Apr 22, 2007
  4. Jack-2
    Replies:
    3
    Views:
    326
    Jack-2
    Dec 24, 2003
  5. Java  script  Dude

    IE name="name" & form.name property bug

    Java script Dude, Jun 29, 2004, in forum: Javascript
    Replies:
    5
    Views:
    283
    Java script Dude
    Jun 30, 2004
Loading...

Share This Page