Sometimes, you might need to patch a file using grub4dos - i.e. replace some bytes in a file with different bytes.
Here is an example of how to do this.
This example patches the boot sector that is created when you run XP Setup winnt.exe. This boot sector is used on the first boot to XP Setup after the Winnt files have been installed to the hard disk.
For more details of this patch, see here.
Note that if run under QEMU or some other emulators, the patch may not work if the volume is marked as 'read-only' by the emulator. For this reason you need to boot and run this grub4dos menu on real hardware.
For details about the grub4dos cat command see Tutorial #21.
To ensure only one instance of the bytes in the file are replaced, add number=1 to the cat command- e.g.
if "%OS%"=="FAT32" cat --skip=0xe6 --number=1 --locate=\x0f\x82\x4a\x00 --replace=\x90\x90\x90\x90 %BT% > nul
Note that --skip is used to position the starting point. If you do not know that start position of the bytes (or the position may vary), simply omit the --skip=xxx parameter.