MBRWizard CLI Reference

Command line reference for MBRWizard CLI version 4.0

Disk and partition selection

The following commands are designed to select the disk and partition for all operations. If no disk is specified, a default value of 0 will be used. If no partition if specified, a default value of 1 will be used.


Usage examples:
Example 1 - Fix MBR on disk 0: mbrwiz /disk=0 /repair=win7
Example 2 - Set partition 1 bootable: mbrwiz /part=1 /active
Example 3 - Show all partitions on disk 1: mbrwiz /disk=1 /list
Example 4 - Hide partition 1 on disk 2: mbrwiz /disk=2 /part=1 /hide
Example 5 - Fix Master Boot Record on disk 2: mbrwiz /disk=2 /repair

CommandModeDescription and Use
/Disk#, or
vmdk filename
Selects the disk to use for all operations. This switch is always processed first, verifying that all operations specified on the command line will use the disk specified here. If not specified, Disk 0 will be used by default.
/Disk=x may also point to an existing VMware .vmdk file, and provides the same functionality as with physical disks.
/Partpart #, system, boot, utilitySelects the partition to use for all operations. The valid partition range is 1-4 for MBR disks, and 1-128 for GPT disks. If this option is not specified a default value of 1 will be used. Note, the numbering scheme changed with version 3.0, and is now one (1) based rather thatn zero (0) base as with previous versions.
Additionally, a partition can be selected by specifying one of the following: system, boot, utility (dell/hp diagnostic partitions). Note, when using these advanced options the, disk to which the specified partition belongs will be automatically selected.
/Volvolume label,
drive letter
Selects the volume for specific operations. Available options are valid volume labels or drive letter (eg. c:). Note, the disk will be automatically selected once the label or letter is matched.

Operational commands

The following commands specify the core operation for MBRWizard to perform. Only a single operational command may be specified on the command line. The Mode column provides options which direct or modify the selected command. The parameters specified in the Additional column define additional requirements, or other information necessary for the command to complete.

CommandModeAdditionalDescription and Use
/Listfreespace,logical, textProvides a detailed view of disk and partition information. /Freespace will further show the available freespace on the disk. /Logical displays any logical partitions. /Text replaces line-draw characters with standard text characters.
/Save=mbr, gpt, vbr, disk, track0, rangefilename, sectorSaves the sectors specified by Mode to the location specified by the filename.
/Restore=mbr, gpt, vbr, disk, track0filenameRestores the contents of Filename to the sectors specified by Mode.
/Show=file, sector, hiddenfilenameDisplays the contents of the backup stored in the specified filename or sector.
/Repair=xp, win7Designed to fix the MBR, this option repairs the master boot record by creating a new Windows XP or Windows 7/Windows 8 MBR on the specified disk. This operation will not modify the partition table or existing partitions on the disk.
/Createstart, size, align, typeCreates a new partition on the specified disk (not currently supported on GPT). If no further options are specified a type 0x7 partition will be created in the first identified freespace. Please see the additional options for more granular control of creating the partition.
/start= starting sector for the new partition, or 'freespace' selects the first available space on the disk
/size= size in MB of the new partition, or MAX for maximum available size
/align= alignment boundary for the new partition (1k, 2k, 4k... 128k, etc)
/type= partition type identifier
/Copysource=x, target=yCopies the information located at sector x to sector y.
/Comparesource=x, target=yAnalyzes two sectors and reports whether they are a identical. /Source and /Target may indicate a filename or sector. When the filename specifies an MBRWizard file the header will be skipped and only the data portion will be compared, otherwise the first sector of the file will be used. If the first digit is a number it will be interpreted as a sector position, which will be read and used for comparison. For example,
mbrwiz.exe /compare /source=0 /target=c:\mymbr.mbw will compare the contents of the .mbw file with sector 0 on the selected disk.
/Signature=read, zero, generate, write Read displays the signature for the specified disk
Zero will wipe the current disk signature and write all zeroes
Generate will randomly create and apply a new disk signature
Write requires an 8 character hex signature to be specified (use with /value to specify the new signature).
/VolumeID=readDisplays the VolumeID for the selected partition..
/DelDeletes the specified partition. Specifying /Part=* removes all partitions on selected disk.
/Type=#Modifies the partition type specified in the partition table to the selected value. The value must be specified as a hexadecimal value.
/HideHides the selected partition
/UnhideUnhides the selected partition
/ActiveSets the selected partition as bootable
/InactiveRemoves the bootable status from the selected partition.
/Wipe=mbr, gpt, disk, track0, rangeClears (deletes) the data located at the specified location.
Specifying 'disk' can take an extended amount of time to complete, and is generally recommended for small disks only.
/SortOccasionally the partition entries in the MBR can become unsorted after reinstalling Windows or restoring a Ghost or Acronis disk image. This means that the partition order in the MBR won't match the order on disk. This option will sort the entries in the MBR to match their physical order on disk.
/WriteinifilenameWrites detailed disk and partition information to filename in a .ini format.
/BootmenuThis option will list the available, bootable partitions to the user, and set one active by selecting from the menu.

Additional helper parameters

The following items are designed as helper parameters, and provide no functionality alone. Although not required, they typically improve automation, reporting, or supplement the capability of other commands.

CommandModeAdditionalDescription and Use
/ConfirmAutomatically confirms the specified operation without user interaction. Equivalent to pressing 'Y' when asked to confirm the action.
/IgnoreAttempts to continue the specified operation if an error occurs.
/ResultDisplays the return code for visual verification of success/failure.
/SilentDisplays only the requested information on the command line by stripping the superflous text. Targeted for /signature=read, /result, etc.
/Msg=#Hides the status messages shown upon program exit. 1-indicates that no messages should be shown, 2-No error messages, and 3-No status messages displayed on success.
/NoHdrStarting with MBRWizard 3.0, backup files include additional information, including disk and partition info, as well as detailed information about the content of the file. The /NoHdr parameter may be specified to create the file without this header.
/Range=x-yRange provides a method for selecting a consecutive range of sectors. The first value identifies the starting sector of the range, while the second value selects the number of sectors in the range.
/Value=Value is used with the /signature=write command, and identifies the 8 digit hex value of the disk signature to be written to disk.
/FreespaceWhen used with the /List command, the freespace on the disk is detailed in addition to the space taken by partitions.
/Shutdown=#1-Force Windows to shutdown
2-Force Windows to shutdown and reboot
3-Shuts down without force
4-Reboots without force.
*Note, using the Force options may cause data loss if open programs contain unsaved data.
/?Show available command line options.

Query commands

The following commands will query system information and return the result as an errorlevel value. Specifying the command /Result to the following parameters will display the requested value to the screen as well.

CommandModeAdditionalDescription and Use
/IsSortedresultQueries the partition entry order in the MBR and returns an ErrorLevel code based on the status of the partition entries:
0=Sorted, 1=Unsorted.
/DiskcountresultReturns the number of disks in the system as an errorlevel return code. Specifying /Result will display this value to the screen.
/PartcountresultReturns the number of partitions located on the selected disk. Specifying /Result will display this value to the screen.
/IsFixedresultReturns a value of 1 if the specified disk is a fixed disk, or 0 if the disk is removable.