Link to home
Start Free TrialLog in
Avatar of dhaun
dhaun

asked on

changing NTFS volume serial number

How can I change the serial number of a NTFS volume? I know how it's stored in the boot sector, but I don't know how to change that either. This has to be done inside NT 4.0; booting DOS isn't an option.
Avatar of jhance
jhance

From what I have been able to determine, you cannot change the NTFS volume serial number through a documented API call.  Obviously, there is a way to do it since MS sets it when you format a new disk.  You might try poking into some of the Win NT system files that might do this with a DISASSEMBLER/DEBUGGER.
Actualy, the only place where the serial number is accessed is in the Format routines.

I managed to change the serial number under DOS and Win3.1 some years ago, never hat to use it afterwards though.

To make a long story short, under both DOS and 3.1, and under NT as far as I have been able to determine from the DOCS, you will need to dissasemble one of the programs containing the formatting routines to obtain the name and address of the driver function that generates and writes the Volume serial number.
If you only want to read/write to the boot-sector, have you tried using createfile("\\physicaldrive0", ...); or something?  It's commented in your help file under createfile.  I think you can access the boot-sector this way.
ASKER CERTIFIED SOLUTION
Avatar of tflai
tflai

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial