Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

How to determine Windows Edition

by geo (Acolyte)
on Apr 22, 2010 at 00:41 UTC ( [id://836168]=perlquestion: print w/replies, xml ) Need Help??

geo has asked for the wisdom of the Perl Monks concerning the following question:

Hello, I am looking for a way to determine the Windows Edition (XP, Vista, Windows 7) of the system running a Perl script. The variable $^O returns the os name but I need a bit more information. If this has been discussed previously, a pointer would be great as I could not find any thread on this subject. Thanks geo

Replies are listed 'Best First'.
Re: How to determine Windows Edition
by BrowserUk (Patriarch) on Apr 22, 2010 at 00:51 UTC

    See Win32 for details:

    C:\test>perl -MWin32 -E" say Win32::GetOSName()" WinVistaService Pack 1 C:\test>perl -E" say Win32::GetOSVersion()" Service Pack 16060012107681

    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      I like it! Thanks for the (very) quick response
Re: How to determine Windows Edition
by Burak (Chaplain) on Apr 22, 2010 at 14:31 UTC
    You can also try my Sys::Info module for a more detailed information:
    use Sys::Info; print Sys::Info->os->name( edition => 1, long => 1 );
    Sample output: Windows Vista Home Premium Edition Service Pack 2 build 6002

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://836168]
Approved by AnomalousMonk
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (3)
As of 2024-04-25 09:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found