> >> If you can open a command shell you can get the OS version with the

> >> 'ver' command under Windows:
> >>
> >> C:\>ver
> >>
> >> Microsoft Windows XP [Version 5.1.2600]
> >
> > How do you do this from a program though. Under UNIX uname() is a 
> > function call as well as a program. It returns the os name, version,

> > hostname and system type.
> >
> 
> GetVersionEx() will get you the windows version, service 
> pack, etc IIRC.

in perl:

use POSIX;
print join(',',POSIX::uname()),"\n";

prints:
Windows NT,hostname.domain.com,5.0,Build 2195 (Service Pack 4),x86

Works on all Platforms.

(more detail on Win with: use Win32; join(' ', Win32::GetOSVersion()),
"\n";)

Andreas

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Reply via email to