Hi,
How can i find the OS name in C++ on which the program is executed. like Windows 2000, Windows XP or Windows Vista?
Thanks for any help.
Hi,
How can i find the OS name in C++ on which the program is executed. like Windows 2000, Windows XP or Windows Vista?
Thanks for any help.
Its in the registry HKLM\Software\Microsoft\Windows NT\Product Name
Try GetVersionEx Windows API function.
See MSDN article(s): http://msdn.microsoft.com/en-us/library/ms724451(VS.85).aspx
If you're also looking for a Linux solution, in sys/utsname.h is the function uname. More info here: http://www.opengroup.org/onlinepubs/009695399/basedefs/sys/utsname.h.html
Try GetVersionEx Windows API function.
See MSDN article(s): http://msdn.microsoft.com/en-us/library/ms724451(VS.85).aspx
Agree -- that provides more info than the registry link I posted.
Thanks a lot everyone. The below links helped a lot.
http://msdn.microsoft.com/en-us/library/ms724451(VS.85).aspx
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.