The command
echo %@serial[C:]
shows the "soft" serial of a disk or partition.
But this number can be changed, for example when one does a disk clone
of a disk: you end with two (or more) disk(s) with the same serial.
But the disk serial hardwired by the disk maker is unique.
This number can be obtained, say for disk 0:
wmic diskdrive 0 get serialnumber
For example:
wmic diskdrive 0 get serialnumber S e r i a l N u m b e r
1 7 1 4 2 1 8 0 2 0 3 1
wmic diskdrive 1 get serialnumber S e r i a l N u m b e r
W D - W M C 6 N 0 E 4 6 3 2 T
wmic diskdrive 2 get serialnumber S e r i a l N u m b e r
W D - W C C 4 M 1 L A 9 F L 3
The output of wmic has NULL characters between serial number
characters.
If one must take a option based in disk (hard) serial, it is difficult
to do.
Is it possible to obtain a string without separator, and without the
header "Serial number"?
Thank you.
OPH.
echo %@serial[C:]
shows the "soft" serial of a disk or partition.
But this number can be changed, for example when one does a disk clone
of a disk: you end with two (or more) disk(s) with the same serial.
But the disk serial hardwired by the disk maker is unique.
This number can be obtained, say for disk 0:
wmic diskdrive 0 get serialnumber
For example:
wmic diskdrive 0 get serialnumber S e r i a l N u m b e r
1 7 1 4 2 1 8 0 2 0 3 1
wmic diskdrive 1 get serialnumber S e r i a l N u m b e r
W D - W M C 6 N 0 E 4 6 3 2 T
wmic diskdrive 2 get serialnumber S e r i a l N u m b e r
W D - W C C 4 M 1 L A 9 F L 3
The output of wmic has NULL characters between serial number
characters.
If one must take a option based in disk (hard) serial, it is difficult
to do.
Is it possible to obtain a string without separator, and without the
header "Serial number"?
Thank you.
OPH.