Getting Serial Number of the Hard Drive Provided by the manufacturer through PHP : How can it be done? I want to store it in a file.
OS : windows 2000,XP,ME,Vista.
Run the following with shell_exec (test in command prompt if needed):
wmic path win32_physicalmedia get Tag,SerialNumber
DISKDRIVE doesn't get the actual serial number for my drive that shows plugged in through an IDE channel. the above seemed to get the actual serial numbers for all of my drives. Tag will also return you what type of drive it is which may be helpful for identifying different drives.
Example output:
SerialNumber Tag
WD-WX55D33JQNZ4 \\.\PHYSICALDRIVE4
S1OKIJNH938475 \\.\PHYSICALDRIVE0
WD-CV44HJ5L765Y \\.\PHYSICALDRIVE1
WD-WX41D65SD1UU \\.\PHYSICALDRIVE2
WD-WXB1SD3OIJHG \\.\PHYSICALDRIVE3
\\.\CDROM0