Skip to main content

[archive] Hard disk serial number...

  • June 7, 2008
  • 6 replies
  • 0 views

[Migrated content. Thread originally posted on 07 June 2008]

I did find some codes on the net, but it's not working with Acu-Compiler.

Anyway, hope someone will find it.

Regards

6 replies

[Migrated content. Thread originally posted on 07 June 2008]

I did find some codes on the net, but it's not working with Acu-Compiler.

Anyway, hope someone will find it.

Regards
Hello,

Does anyone would like to share a program to get the internal hard disk serial number in windows platform?

Regards...

[Migrated content. Thread originally posted on 07 June 2008]

I did find some codes on the net, but it's not working with Acu-Compiler.

Anyway, hope someone will find it.

Regards
The API function GetVolumeInformation will give you the serial number.

I am afraid I have no code showing this right away, perhaps someone has.

[Migrated content. Thread originally posted on 07 June 2008]

I did find some codes on the net, but it's not working with Acu-Compiler.

Anyway, hope someone will find it.

Regards
I am pretty sure I made a sample program of this once and posted in the forum, have you searched in old posts?

[Migrated content. Thread originally posted on 07 June 2008]

I did find some codes on the net, but it's not working with Acu-Compiler.

Anyway, hope someone will find it.

Regards
I scanned this forum, but nothing....
I appreciate if you can post it again.
Regards,

[Migrated content. Thread originally posted on 07 June 2008]

I did find some codes on the net, but it's not working with Acu-Compiler.

Anyway, hope someone will find it.

Regards

       IDENTIFICATION  DIVISION.
       PROGRAM-ID.     GetVolumeInformation.
       WORKING-STORAGE SECTION.
       77  BufferSize               PIC X(4) COMP-N.
       77  VolumeSerialNumber       PIC X(4) COMP-N.
       77  MaximumComponentLength   PIC X(4) COMP-N.
       77  FileSystemFlags          PIC X(4) COMP-N.
       77  RootPathName             PIC X(2048).
       77  VolumeName               PIC X(2048).
       77  FileSystemName           PIC X(2048).
       77  DisplayVolumeSerial      PIC 9(10).
       PROCEDURE   DIVISION.
       MAIN-LOGIC.
           CALL    "[EMAIL="KERNEL32.DLL@WINAPI"]KERNEL32.DLL@WINAPI[/EMAIL]".
           MOVE    2048             TO BufferSize.
           CALL    "GetCurrentDirectoryA" USING
                   BY VALUE         BufferSize
                   BY REFERENCE     RootPathName.
                   
           DISPLAY MESSAGE BOX
                   RootPathName
                   TITLE            "Current directory"
                   ICON             01
                   TYPE             01.
           MOVE    LOW-VALUE        TO RootPathName(4:1).
           CALL    "GetVolumeInformationA" USING
                   BY REFERENCE     RootPathName
                   BY REFERENCE     VolumeName
                   BY VALUE         BufferSize
                   BY REFERENCE     VolumeSerialNumber
                   BY REFERENCE     MaximumComponentLength
                   BY REFERENCE     FileSystemFlags
                   BY REFERENCE     FileSystemName
                   BY VALUE         BufferSize.
           MOVE    VolumeSerialNumber TO DisplayVolumeSerial.
           DISPLAY MESSAGE BOX
                   "Disk:"          x"09" x"09" RootPathName x"0a"
                   "Volume:"        x"09" x"09" VolumeName x"0a"
                   "File system:"   x"09" FileSystemName x"0a"
                   "Vol Serial:"    x"09" x"09" DisplayVolumeSerial
                   TITLE            "Volume information"
                   ICON             01
                   TYPE             01.
           CANCEL  "KERNEL32.DLL".
           GOBACK.


[Migrated content. Thread originally posted on 07 June 2008]

I did find some codes on the net, but it's not working with Acu-Compiler.

Anyway, hope someone will find it.

Regards
Thank you very very very very musch, you've done for me a great help.

Regards...