Recent

Author Topic: [SOLVED] How to find out the hardware parameters of a PC?  (Read 9787 times)

Wargan

  • New Member
  • *
  • Posts: 48
    • 'This way' site
[SOLVED] How to find out the hardware parameters of a PC?
« on: May 02, 2017, 06:47:27 am »
Hello!

What code should I use to find out the following PC settings?
  • The amount of RAM
  • Video memory: vendor/size
  • Windows username
  • Size of the hard drive
  • Is the installation disk a hard drive or a USB flash drive? :)

p.s. I'm programming under Windows.
« Last Edit: May 02, 2017, 01:20:13 pm by Wargan »
Lazarus 1.8RC5+ FPC 3.0.4.
Windows 7 x32, RAM 3 Gb.

balazsszekely

  • Guest

Thaddy

  • Hero Member
  • *****
  • Posts: 14197
  • Probably until I exterminate Putin.
Re: How to find out the hardware parameters of a PC?
« Reply #2 on: May 02, 2017, 11:32:41 am »
Hm. Directly through the registry, maybe? HKEY_LOCAL_MACHINE\HARDWARE\  and then DESCRIPTION\ and sub keys etc. Easy.
Specialize a type, not a var.

ahiggins

  • Jr. Member
  • **
  • Posts: 92
Re: How to find out the hardware parameters of a PC?
« Reply #3 on: May 02, 2017, 11:56:15 am »
You could try WMI Delphi Code Creator, I've used it in the past to get system serial numbers/asset details.

https://theroadtodelphi.com/wmi-delphi-code-creator/

Thaddy

  • Hero Member
  • *****
  • Posts: 14197
  • Probably until I exterminate Putin.
Re: How to find out the hardware parameters of a PC?
« Reply #4 on: May 02, 2017, 12:00:49 pm »
You could try WMI Delphi Code Creator, I've used it in the past to get system serial numbers/asset details.

https://theroadtodelphi.com/wmi-delphi-code-creator/
WMI will work, as i wrote before, but direct registry access is much quicker and generates less code.
Specialize a type, not a var.

Wargan

  • New Member
  • *
  • Posts: 48
    • 'This way' site
Lazarus 1.8RC5+ FPC 3.0.4.
Windows 7 x32, RAM 3 Gb.

ahiggins

  • Jr. Member
  • **
  • Posts: 92
Re: How to find out the hardware parameters of a PC?
« Reply #6 on: May 02, 2017, 12:10:37 pm »
sorry, did not check the download link, you may have to Google WMI Delphi Code Creator download or try CNET etc

Thaddy

  • Hero Member
  • *****
  • Posts: 14197
  • Probably until I exterminate Putin.
Re: How to find out the hardware parameters of a PC?
« Reply #7 on: May 02, 2017, 12:13:52 pm »
The site DOES work. Use ABP to skip all the sh*t in between.
Specialize a type, not a var.

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: How to find out the hardware parameters of a PC?
« Reply #8 on: May 02, 2017, 01:06:41 pm »
projects repo is at https://github.com/RRUZ/wmi-delphi-code-creator
it has download links for the binaries as well.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

Wargan

  • New Member
  • *
  • Posts: 48
    • 'This way' site
Re: How to find out the hardware parameters of a PC?
« Reply #9 on: May 02, 2017, 01:19:47 pm »
Many thanks to all!

I downloaded the WMI Delphi Code Generator from here.

After installation in the settings you can specify generation of code for FreePascal.
Lazarus 1.8RC5+ FPC 3.0.4.
Windows 7 x32, RAM 3 Gb.

 

TinyPortal © 2005-2018