![]() ![]() ![]() Int(n hd.Count - 1) serial hdn. value has the serial, that's because the wql query of wmi returns a file not the value of a field. It will give you the computer's hard drive serial number and processor serial number, which is a combination that won't likely exist anywhere else on planet earth. dim bios as arraylist Bios ocomponents.getserial('WIN32Bios', 'SerialNumber') then you need a function for retrieving the last position of the arraylist that is value. SScript.RegRead ('HKLMSOFTWAREMicrosoftWindows NTCurrentVersionProductId') Unable to open registry key 'HKLMSOFTWAREMicrosoftWindows NTCurrentVersionProductId' for reading. Paste the following code in a standard module just as you see it here, and run the macro named "CompSpex". I am trying to get the Windows Serial Number in Windows 7 with my VB6 application. Since the BIOS is loaded into RAM at startup you could read, say, 50 bytes of BIOS to get a string. What you would be better off identifying is one or more hardware components to give you more of a truly unique identification of the PC. There's an undocumented VB function: Declare Sub GetMem1 Lib 'msvbvm60.dll' (ByVal MemAddress As Long, var As Byte) It lets you read one byte of memory at a time. ![]() Besides, that label can be scratched off or replaced with a fake label. ![]() That number won't mean anything, because hardware can be easily swapped, so whatever the serial number was when it left the factory can be misrepresented by altered specifications (swapped hard drive, added ram, etc). If you really want the computers' serial numbers in your building, then walk through the building to each computer, and write down the numbers as they appear on their label. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |