OS Version and Name

Posted on 2004-08-26
Medium Priority
Last Modified: 2013-11-17
I want to know how to I find out, using Builder c++ 6, the OS Version and Name.

So that way I can check if is running under windows 95, 98, 2000 or XP

I would like to retrive the os name - e.g. Windows 95 or Windows XP, the version if possible

If someboby can help if a sample code, will be nice

Question by:torlani
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
LVL 11

Accepted Solution

Jase-Coder earned 120 total points
ID: 11904517
I wrote something like that it delphi  here is the source


open the .pas

It is in delphi but the code is easy to understand and it uses some windows API's

Author Comment

ID: 11904901
I understad your code, but I try to implement in Builder and is not working, I not sure what do I have to do so builder will understad the "Win32Platform"

if someone can get a builder example, will help
LVL 11

Expert Comment

ID: 11906039
I am, at the minute reconfiguring my whole system. I should have builder reinstalled tomorrow and i'll rewrite the code.
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 11906681
no problem ... Thanks again for the help
LVL 16

Assisted Solution

by:George Tokas
George Tokas earned 680 total points
ID: 11906960
This is one way you can use:

osinfo.dwOSVersionInfoSize = sizeof(osinfo);

if(osinfo.dwPlatformId == VER_PLATFORM_WIN32s){}// Windows Win32s
if(osinfo.dwPlatformId == VER_PLATFORM_WINDOWS){}// Windows 9x
if(osinfo.dwPlatformId == VER_PLATFORM_WIN32_NT){}// Windows NT XP 2k....

osinfo is a structure.
accessing the dwMajorVersion & dwMinorVersion member you can find out if it is XP, 2k, 2003 etc.


Author Comment

ID: 11907704
sorry gtokas, I mess up in clicking you as the accepted answer, but I gave you 170 points, so it should be ok ... I am sorry for that.
LVL 16

Expert Comment

by:George Tokas
ID: 11911141


Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question