Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to detect that program is running on Win2000

Status
Not open for further replies.

uprichard

Programmer
May 2, 2002
16
I need to detect which OS the perl program is running on. I can not use $os = $ENV{'OS'}; as that returns Windows_NT

Any one know how to detect the correct OS?
 
Win 2K is NT 5.0,

On a windows2000 platform, you could call "ver" which should return the OS version (works here on XP & 98)

This works, you can tailor that

$os=`ver`;
print "$os";
 
The Perl internal variable $^O holds the operating system type, with valid strings of

MacOS
MSWin32
os2
VMS
epoc
NetWare
dos
cygwin

For further info, if you are running via a web server (eg IIS or Apache) then you can check the value of $ENV{'OS'}.

Barbie
Leader of Birmingham Perl Mongers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top