You should use "set part num 0 7 4" to give the ID 0x5 to partition 0x7.
The num starts from 0, not from 1 (it is 0 based).
The same thing applied on MBR disks (where "set part id" doesn't work).
Last edited by Eric on Fri Aug 27, 2021 7:02 pm, edited 1 time in total.
Take care that Windows may reorder all those IDs on some cases. I don't remember exactly when (probably just when connecting the disk, or when booting into that disk, or when creating a partition...), but I know that such thing may appears.
hi Eric, thnx. I came to the same conclusion. however both partition identifiers describe the same thing one current the other new. I'd say that constitutes either a bug over very bad design.
tbscript is a bit of mess concerning indexes tbh.
I reorder them whenever I need them and they're wrong so no worries.
Isn't the Partition Id the same as the table entry number except for it being off by 1? So why stick to the Id in one instance and to the number representing the same thing somewhere else? It just creates confusion, makes the code it's used in excessively complex and difficult to read. Stating it's a zero based array doesn't explain anything, it just raises more question. Also the partid parameter name is inconsistently used through out these functions.
The id's are just int's right? Which are binary, they can be represented in either hex and decimal.
I understand tbscript is not a full fledged programming language and is based off of VB6. But still consistency and proper naming are key to writing good code.
This is meant as feedback not as negativity. I think the quality of the documentation and samples do not do your great support and products justice!
The partition ID is part of the EMBR spec. MBR doesn't have them so the partition entry+1 is used, GPT for convenience the partition table entry+1 is used as well so you don't have to always deal with GUIDs. Likewise extended partition volumes are a combination of the partition entry and optionally sequential or set to a fixed random value. It's going to be labeled id or partid or partitionid based on how long the help line would be, but it's all the same thing.