Hard Drive Serial Numbers

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
david.silmanBUSrUeQ
Posts: 44
Joined: Thu Jul 19, 2012 1:49 pm

Hard Drive Serial Numbers

Post by david.silmanBUSrUeQ » Wed Feb 06, 2013 10:12 am

Hi all

I need to be able to get the serial number of the system hard drive, I can do this on windows using:

Code: Select all

put $SYSTEMDRIVE into tStrFieldData
put shell("vol "&tStrFieldData) into tStrFieldData
put line 2 of tStrFieldData into tStrFieldData
put word (wordOffset("is",tStrFieldData)+1) to -1 of tStrFieldData into tStrFieldData
however, I don't know of a way to do this for mac, can anyone help me?
(also, not really needed, but if it's known, iPad and Android tablet too?)

Many thanks
David

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Hard Drive Serial Numbers

Post by Klaus » Wed Feb 06, 2013 1:10 pm

Hi David,

maybe this is of interest for you?
Not exactly what you were asking for, but worth a look :D
http://www.sonsothunder.com/devres/live ... env001.htm

Be sure to also check all other hints and tips here:
http://www.sonsothunder.com/devres/live ... vecode.htm

Best

Klaus

david.silmanBUSrUeQ
Posts: 44
Joined: Thu Jul 19, 2012 1:49 pm

Re: Hard Drive Serial Numbers

Post by david.silmanBUSrUeQ » Wed Feb 06, 2013 1:57 pm

Thanks Klaus

Not quite what I was after originally (like you said) but we've decided to use the MAC address anyway

Cheers
David

user#606
Posts: 217
Joined: Sun Jan 27, 2008 12:25 pm
Contact:

Re: Hard Drive Serial Numbers

Post by user#606 » Mon Feb 11, 2013 3:14 pm

And how did you get the mac address?
Other users might like to know.

david.silmanBUSrUeQ
Posts: 44
Joined: Thu Jul 19, 2012 1:49 pm

Re: Hard Drive Serial Numbers

Post by david.silmanBUSrUeQ » Wed Feb 13, 2013 3:30 pm

Hi user#606

Sorry, but in the end I only found a way to get the mac address of windows/mac/linux
http://www.sonsothunder.com/devres/live ... env001.htm

Although, there was an external for getting the mac address of iOS, see my other post here:
http://forums.runrev.com/phpBB2/viewtop ... =8&t=14079

Also from that, still no one-for-all solution so there was this post:
http://forums.runrev.com/phpBB2/viewtop ... =8&t=14081

Hope this helps
David

NoN'
Posts: 96
Joined: Thu Jul 03, 2008 9:56 pm
Contact:

Re: Hard Drive Serial Numbers

Post by NoN' » Sun Feb 24, 2013 11:24 pm

Hello David,

Use the "shell" command to get a drive number on Mac Os.

If you want the full information about system and materiel:

Code: Select all

on mouseUp
   put "" into resum
   set cursor to busy
   put "put shell (" & quote & "system_profiler" & quote & ") into resum" into lacomm
   do lacomm
   put resum into fld "resum"
end mouseUp

If you just want a part of the information :

Code: Select all

on mouseUp
   put "" into resum
   set cursor to busy
   put "put shell (" & quote & "system_profiler SPSerialATADataType" & quote & ") into resum" into lacomm
   do lacomm
   put resum into fld "resum"
end mouseUp
You will obtain this kind of poem :
Serial-ATA:

NVidia MCP79 AHCI:

Vendor: NVidia
Product: MCP79 AHCI
Link Speed: 3 Gigabit
Negotiated Link Speed: 3 Gigabit
Description: AHCI Version 1.20 Supported

Hitachi HDT721032SLA380:

Capacity: 320,07 GB (320 072 933 376 bytes)
Model: Hitachi HDT721032SLA380
Revision: ST0KA36A
Serial Number: STA123SNUMBERXYZ
Native Command Queuing: Yes
Queue Depth: 32
Removable Media: No
Detachable Drive: No
BSD Name: disk0
Rotational Rate: 7200
Medium Type: Rotational
Partition Map Type: GPT (GUID Partition Table)
S.M.A.R.T. status: Verified
Volumes:
Capacity: 209,7 MB (209 715 200 bytes)
Writable: Yes
BSD Name: disk0s1
Macintosh HD:
Capacity: 319,73 GB (319 728 959 488 bytes)
Available: 230,34 GB (230 343 659 520 bytes)
Writable: Yes
File System: Journaled HFS+
BSD Name: disk0s2
Mount Point: /
Change the "SPSerialATADataType" with "SPIDEDataType" to get informations on IDE disks (for example).

With the hope it will help you

Renaud

Post Reply