How to detect operating system name in C Language
Hello,
I want to know that,is there any feature which let me know which operating system version my computer system is running on? but that should be with the help of Programming language such as (2000, Vista, XP ....)?
It would be more helpful for me if you provide me in C programing language.
Thanks for your help
Re: How to detect the operating system name in c language
Hello,
you may also check the operating system name through your DOS Prompt.But if you are not able to see it using DOS then you have the "worm" in dos (command prompt).
Re: How to detect the operating system name in C Language
You may check for your system version through GetVersion (), GetVersionEx (), etc.Actually i also read this in one of blog so i can't give more specific answer to you question.
Re: How to detect the operating system name in C language
What name you want because otherwise you can do something like this
Code:
if (version_majeure = 5) and (minor = 3)
then OS = "XP SP3"
is pseudo code but when I read the code of the example of MSDN GetVersion (), I am not very far
Code:
void main ()
(
DWORD dwVersion = 0;
DWORD dwMajorVersion = 0;
DWORD dwMinorVersion = 0;
DWORD dwBuild = 0;
dwVersion GetVersion = ();
/ / Get the Windows version.
dwMajorVersion = (DWORD) (LOBYTE (LOWORD (dwVersion)));
dwMinorVersion = (DWORD) (Hibyte (LOWORD (dwVersion)));
/ / Get the build number.
if (dwVersion <0x80000000)
dwBuild = (DWORD) (HIWORD (dwVersion));
printf ( "Version is% d.% d (% d) \ n",
dwMajorVersion,
dwMinorVersion,
dwBuild);
)