Hello to all! How to find out information about the system in Delphi?

    3 answers 3

    Delphi do it very difficult. You can easily get information about the state of RAM, user name, computer name, even the OS version, but no more. I do not know what you are doing there, but personally I advise you to use the Windows console. There is a special command: systeminfo , which gives a very detailed information about the system, up to the issuance of information about network adapters.

    If a little bit, just think a little, then you can transfer the output, output all the info to the file:

     chcp 1251 systeminfo > C:\ sysInfo.txt 

    Then parse info and do with it what you want.

    In Delphi, all of the above will look something like this:

     WinExec('cmd /c systeminfo > C:\ sysInfo.txt ',1); 
    • Thank you, I thought it could be just a ListBox1.Items.LoadFromFile ('C: \ sysInfo.txt'); I robs) But why is it displayed like this? € ¬p g§ ": RCON_PRO Ќ §ў Ґ Ґ Ћ ': Microsoft Windows 7 : Microsoft Corporation Џ a Ґ Ґ Ћ Ћ::: € € € € ® ® ® ® ® ® з з
    • one
      Because first you need to install the Russian encoding: chcp 1251 How to execute this command and the other right away, now I figure it out myself ... - Salivan
    • I think you guessed it like this: WinExec ('cmd / c chcp 1251 && systeminfo> C: \ sysInfo.txt', 1); - Salivan

    I look at the question closed, but I still will answer ... It is necessary to decide what information interests about the system. There is a very cool thing called WMIC. With it, you can disassemble the system into parts. I use it in C # to get various information from the system. You can also get data through the command line, as advised to you above, but it is better to use the Delphi class to work with it. For example, the command:

    WMIC CLASS Win32_Processor

    Receives full information about the processor of the machine. There are ALIAS ready-made, but you can specify a specific class that interests you. Full information on classes is in MSDN Help, there are a lot of classes, so I’ll repeat once again, you need to decide what information about the system you need. Here you can start reading to get a complete picture of what information you can get with the WMIC classes: MSDN

      There is a JVCL library in its composition there is a Unit JvComputerInfoEx. Another thing is not a bad article http://www.vr-online.ru/content/delphi-sobiraem-informaciju-o-kompe-2999 But again, it all depends on what kind of information you need to get.