VOGONS


First post, by Exploit

User metadata
Rank Member
Rank
Member

When you use the DIR command in MS-DOS from version 4.x onwards, if the partition was also created under MS-DOS 4.x or later, the Volume Serial Number is always displayed. This consists of 8 hex digits, separated in the middle by a hyphen. Unlike the drive letter (A:, B:, C:, D: etc.) or the 8-character drive label, this serial number is generated randomly when the partition is created and thus remains unique with a certain probability. This allows a specific partition to be uniquely identified, and modern operating systems, such as those from Windows NT onwards, also use such a unique identifier to, for example, find programs in the correct location if the drive letters have changed due to adding more drives.

But under DOS, I don't know of any program that benefited from or used this function.

Paths were used absolutely. Batch files, like AUTOEXEC.BAT, continued to use absolute paths with the drive letter. When a device was added, the assignment of drive letters usually changed on IDE/ATA drives (with SCSI, this could be avoided.), and the batch file no longer worked because the absolute path pointed to nothing or the wrong disk. If it had been possible to use the volume serial number as an identifier, as modern systems do, this problem could have been easily avoided. But apparently, it was never used.

The BATCH scripting language also did not support the Volume Serial Number, which was another reason it was not used

DR-DOS also did not support this function in Novell DOS 7.x. Only MS-DOS from version 4.x and FreeDOS supported it. Otherwise, this function also had a disadvantage as it caused an extra line to be output in the DIR command because of this serial number.

So did this serial number have any use for you?

Reply 1 of 10, by Azarien

User metadata
Rank Oldbie
Rank
Oldbie

But under DOS, I don't know of any program that benefited from or used this function.

I don't know if it was used for that purpose, but I can imagine things like smartdrive might check for it on removable media (floppies) and invalidate all cache for that drive if the serial number suddenly changed.

Reply 2 of 10, by jakethompson1

User metadata
Rank l33t
Rank
l33t

Did OS/2 1.x make any particular use of it, being around the same time?

Reply 3 of 10, by igully

User metadata
Rank Newbie
Rank
Newbie

I believe I am not the only one, but I use the serial number to identify the type of drive in a couple of programs I designed.
Not all type of drives have the serial number field and this helps me narrow down the type.

There is probably some copy protection scheme out there that uses it too.

Reply 4 of 10, by Grzyb

User metadata
Rank l33t
Rank
l33t
igully wrote on Yesterday, 18:27:

There is probably some copy protection scheme out there that uses it too.

Doubtful, as it would be a very weak scheme.

Indeed, the DISKCOPY command shipped with DOS changes the serial number, making it possible to easily tell apart the copy from the original.
Third-party copiers, however, simply copy the number like everything else.

Nie rzucim ziemi, skąd nasz root!

Reply 5 of 10, by igully

User metadata
Rank Newbie
Rank
Newbie

It is not a weak scheme, it is just one more element used for helping achieve that job. It is not easy to find the drive type under DOS (RAM, CD, NETWORK, HDD, etc.). Just take a look at the programs that attempt to find CD-ROMs and ram volumes. There are many with source code where you can find where the methodology fails. They are not straightforward. They have to rely on many assumptions, and as said, may eventually fail under some circumstances.

It is used alongside other information to confirm the drive type (bytes per sector, media type IOCTL, SUBST, JOIN and other type of links, etc.). The more information you gather better are the probabilities of detecting a drive type to a higher degree. This is also dependent on file system.

Another example (not mine) where they use this feature to find drive types is available here:
http://www.manmrk.net/tutorials/batch/DOSBatch1.htm#17

Reply 6 of 10, by Exploit

User metadata
Rank Member
Rank
Member
Grzyb wrote on Yesterday, 19:15:

Indeed, the DISKCOPY command shipped with DOS changes the serial number, making it possible to easily tell apart the copy from the original.
Third-party copiers, however, simply copy the number like everything else.

I was curious about how DISKCOPY of DR-DOS 7.03 (Novel/Caldera DOS) behaves. Therefore, I ran a test with its DISKCOPY. DISKCOPY of DR-DOS 7.0.3 does copy the diskette, but creates a completely new volume serial number for the target diskette. If an old one existed, it is overwritten. Thus, the copy is not identical.

That means that at least DISKCOPY of DR-DOS has knowledge of the volume serial number, even if the DIR or VOL command does not. My previous assumption in my first comment is thus not entirely correct.

Last edited by Exploit on 2025-11-06, 20:34. Edited 1 time in total.

Reply 7 of 10, by Grzyb

User metadata
Rank l33t
Rank
l33t
igully wrote on Yesterday, 19:55:

It is not a weak scheme, it is just one more element used for helping achieve that job.

OK, I'm inclined to believe that volume serial number can be used to prevent *installed* copy of a program from being run on another machine.
But it's pretty much useless for copy-protection of the installation media.

Nie rzucim ziemi, skąd nasz root!

Reply 8 of 10, by Grzyb

User metadata
Rank l33t
Rank
l33t
Exploit wrote on Yesterday, 20:30:

I was curious about how DISKCOPY of DR-DOS 7.03 (Novel/Caldera DOS) behaves. Therefore, I ran a test with its DISKCOPY. DISKCOPY of DR-DOS 7.0.3 does copy the diskette, but creates a completely new volume serial number for the target diskette. If an old one existed, it is overwritten. Thus, the copy is not identical.

So it behaves exactly like DISKCOPY from PC DOS and MS-DOS.
But try eg. DISKDUPE, DSKIMAGE, VGACOPY... they all create identical copies!

Nie rzucim ziemi, skąd nasz root!

Reply 9 of 10, by Exploit

User metadata
Rank Member
Rank
Member
Grzyb wrote on Yesterday, 20:37:

So it behaves exactly like DISKCOPY from PC DOS and MS-DOS.
But try eg. DISKDUPE, DSKIMAGE, VGACOPY... they all create identical copies!

I just tested it with HD-COPY and VGACOPY inside a QEMU VM.

VGACOPY behaves like DISKCOPY. It changes the Volume Serial Number.
HD-COPY creates an exact 1:1 copy. The volume serial number is the same.

That is strange. Because normally a large part of the copy function of VGACOPY is based on HD-COPY. BTW. in QEMU, HD-COPY is much faster than VGACOPY.

Reply 10 of 10, by Grzyb

User metadata
Rank l33t
Rank
l33t
Exploit wrote on Yesterday, 21:27:

VGACOPY behaves like DISKCOPY. It changes the Volume Serial Number.

OK, it's possible.
But I'm 100% sure about DISKDUPE and DSKIMAGE - they don't change that number.

Nie rzucim ziemi, skąd nasz root!