How can i programicly find out what operating system i am using?

J

James

How can i programicly find out what operating system i am using? i have
tried using:
getenv("OS");
it works works on xp/2000 but it doesn't seem to work on windows95/98/ME.

im using ms visual c++ 6
 
B

Buster

James said:
How can i programicly find out what operating system i am using? i have
tried using:
getenv("OS");
it works works on xp/2000 but it doesn't seem to work on windows95/98/ME.

Look up "GetVersion" in your Win32 API documentation.
 
K

Kevin Goodsell

James said:
How can i programicly find out what operating system i am using? i have
tried using:
getenv("OS");
it works works on xp/2000 but it doesn't seem to work on windows95/98/ME.

im using ms visual c++ 6

No reliable way in standard C++. If you are only interested in Windows
versions, you might be able to find something in the Windows API (or ask
in a Windows programming group).

-Kevin
 
R

Roger Leigh

James said:
How can i programicly find out what operating system i am using? i have
tried using:

On any posix-compliant OS, which includes Windows NT apparently, you
can use the uname(2) system call. There is no Standard way to do
this.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top