I'm not sure how to do this in a regular batch file, but here's how you can do it with PowerShell using an example of setting up crash actions for an ASP.NET state service:
Let's say that this is what the export of your value looks like:
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\aspnet_state] "FailureActions"=hex:50,33,01,00,00,00,00,00,00,00,00,00,03,00,00,00,0e,00,00,\ 00,01,00,00,00,00,00,00,00,01,00,00,00,00,00,00,00,01,00,00,00,00,00,00,00
You put the hexadecimal values ββin an array of bytes, and then use this value to set the registry value:
$failureActionsValue = ([byte[]](80,51,01,00,00,00,00,00,00,00,00,00,03,00,00,00,14,00,00,00,01,00,00,00,00,00,00,00,01,00,00,00,00,00,00,00,01,00,00,00,00,00,00,00)) Set-ItemProperty -Path 'HKLM:\System\ControlSet001\services\aspnet_state' -Name "FailureActions" -Value $failureActionsValue