# The grub4dos hide and unhide commands just changes the partition type in the MBR partition table - e.g. from 07 to 17.
# true_hide/true_unhide also makes partitions inaccessible to Windows and linux
# The menu below is just an example to show how to use the E2B .g4b hide/unhide batch files
# parttype will return the partition type number, so the menu entry will only be displayed if required
# we don't want to make the type F extended partition table entry hidden or else all logical partitions will be hidden.
# redirect the call to nul if you don't want to see any diagnostic text - e.g. call /%grub%/true_hide.g4b (hd0,1) > nul

iftitle [parttype (hd0,0) &; set /A p=%@retval% &; if not %p%==0x0F && calc %p%&0x10^0x10] TRUE HIDE HD0,0\n Hide 1st partition on first hard disk (E2B USB drive)
set p=
call /%grub%/true_hide.g4b (hd0,0)
pause
# Reload menu
configfile (md)0xa000+0x50 || configfile /menu.lst

iftitle [parttype (hd0,0) &; set /A p=%@retval% &; if not %p%==0x0F && calc %p%&0x10] TRUE UNHIDE HD0,0\n Unhide 1st partition on first hard disk (E2B USB drive)
set p=
call /%grub%/true_unhide.g4b (hd0,0)
pause
# Reload menu
configfile (md)0xa000+0x50 || configfile /menu.lst


iftitle [parttype (hd0,1) &; set /A p=%@retval% &; if not %p%==0x0F && calc %p%&0x10^0x10] TRUE HIDE HD0,1\n Hide 2nd partition on first hard disk (E2B USB drive)
set p=
call /%grub%/true_hide.g4b (hd0,1)
pause
# Reload menu
configfile (md)0xa000+0x50 || configfile /menu.lst

iftitle [parttype (hd0,1) &; set /A p=%@retval% &; if not %p%==0x0F && calc %p%&0x10] TRUE UNHIDE HD0,1\n Unhide 2nd partition on first hard disk (E2B USB drive)
set p=
call /%grub%/true_unhide.g4b (hd0,1)
pause
# Reload menu
configfile (md)0xa000+0x50 || configfile /menu.lst

 

iftitle [parttype (hd0,2) &; set /A p=%@retval% &; if not %p%==0x0F && calc %p%&0x10^0x10] TRUE HIDE HD0,2\n Hide 3rd partition on first hard disk (E2B USB drive)
set p=
call /%grub%/true_hide.g4b (hd0,2)
pause
# Reload menu
configfile (md)0xa000+0x50 || configfile /menu.lst

iftitle [parttype (hd0,2) &; set /A p=%@retval% &; if not %p%==0x0F && calc %p%&0x10] TRUE UNHIDE HD0,2\n Unhide 3rd partition on first hard disk (E2B USB drive)
set p=
call /%grub%/true_unhide.g4b (hd0,2)
pause
# Reload menu
configfile (md)0xa000+0x50 || configfile /menu.lst



iftitle [parttype (hd0,4) &; set /A p=%@retval% &; if not %p%==0x0F && calc %p%&0x10^0x10] TRUE HIDE HD0,4\n Hide 1st logical partition on first hard disk (E2B USB drive)
set p=
call /%grub%/true_hide.g4b (hd0,4)
pause
# Reload menu
configfile (md)0xa000+0x50 || configfile /menu.lst

iftitle [parttype (hd0,4) &; set /A p=%@retval% &; if not %p%==0x0F && calc %p%&0x10] TRUE UNHIDE HD0,4\n Unhide 1st logical partition on first hard disk (E2B USB drive)
set p=
call /%grub%/true_unhide.g4b (hd0,4)
pause
# Reload menu
configfile (md)0xa000+0x50 || configfile /menu.lst


iftitle [parttype (hd0,5) &; set /A p=%@retval% &; if not %p%==0x0F && calc %p%&0x10^0x10] TRUE HIDE HD0,5\n Hide 2nd logical partition on first hard disk (E2B USB drive)
set p=
call /%grub%/true_hide.g4b (hd0,5)
pause
# Reload menu
configfile (md)0xa000+0x50 || configfile /menu.lst

iftitle [parttype (hd0,5) &; set /A p=%@retval% &; if not %p%==0x0F && calc %p%&0x10] TRUE UNHIDE HD0,5\n Unhide 2nd logical partition on first hard disk (E2B USB drive)
set p=
call /%grub%/true_unhide.g4b (hd0,5)
pause
# Reload menu
configfile (md)0xa000+0x50 || configfile /menu.lst


# this menu entry is never seen but it clears the p variable to keep things tidy!
iftitle [set p= && if 1=2] clear p
boot
