The only nasty option I've found so far is to create a REG file and import it:
call :regnone HKEY_CURRENT_USER "keyname" valuename goto :eof :regnone rem create a reg file echo Windows Registry Editor Version 5.00 > none.reg echo [%~1\%~2] >> none.reg echo "%~3"=hex(0): >> none.reg rem import it the registry reg import none.reg del /q none.reg goto :eof
REG_NONE is a special type that, due to implementation details (command line tools are optimized for String and multi string) can only be created with a binary value of zero length using the RegSetValueEx windows api. A higher level api, such as the one on the WMI provider, allows SetBinaryValue and no SetNoneValue . Besides REG there is also the possibility to use wmic, which comes a little closer to the WMI provider, but it still does not allow you to create the REG_NONE type (it allows you to create REG_BINARY with zero length, that is, REG also cannot)
The closest null binary value you can get with this command (provided by MC ND )
reg add "hkcu\volatile environment" /v test /t reg_binary
are two null bytes: 00 00 caused by two null character terminations (not provided with the /d option) multi String
source share