Results 1 to 4 of 4

Thread: How to detect operating system name in C Language

  1. #1
    Join Date
    Feb 2009
    Posts
    35

    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

  2. #2
    Join Date
    Dec 2008
    Posts
    183

    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).

  3. #3
    Join Date
    Jan 2009
    Posts
    84

    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.

  4. #4
    Join Date
    Mar 2008
    Posts
    258

    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); 
      )

Similar Threads

  1. Replies: 9
    Last Post: 03-01-2012, 07:40 AM
  2. Laptop is unable to detect the operating system.
    By Enos in forum Operating Systems
    Replies: 5
    Last Post: 13-12-2010, 11:16 PM
  3. Aspire 5738DG Operating System Language Change
    By Mick$Tyler in forum Portable Devices
    Replies: 4
    Last Post: 08-10-2010, 06:45 AM
  4. Gentoo operating system vs Debian operating system.
    By DEWITT in forum Operating Systems
    Replies: 4
    Last Post: 05-01-2010, 12:49 AM
  5. Replies: 3
    Last Post: 01-07-2009, 08:11 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,625,167.89695 seconds with 16 queries