本帖最后由 aries215 于 2026-10-4 03:55 编辑
要求:只许用批处理 reg add 命令,正确转义实现无损导入。
提示:这是格式转换,不谈 regedit /s,谢谢参与!
- @echo off
- reg add "HKLM\SOFTWARE\TEST!ABC" /v "multistr" /t REG_MULTI_SZ /d "aaaaaaa\\0aaaaaa\0bbbbbbbbbbb\0cccccccccccc\0" /f
- reg add "HKLM\SOFTWARE\TEST!ABC" /v "multistr2" /t REG_MULTI_SZ /d "1\\0\\\\\0222\\\0" /f
- reg add "HKLM\SOFTWARE\TEST!ABC\~!@#$%%^&*()_+|}{:\"?><,./;'[]=-" /v "\~!@#$%%^&*()_+|}{:\"?><,./;'[]=-\\" /t REG_SZ /d "\~!@#$%%^&*()_+|}{:\"?><,./;'[]=-\\" /f
- pause
复制代码
原始注册表:
- Windows Registry Editor Version 5.00
- [HKEY_LOCAL_MACHINE\SOFTWARE\TEST!ABC]
- "multistr"=hex(7):61,00,61,00,61,00,61,00,61,00,61,00,61,00,5c,00,30,00,61,00,\
- 61,00,61,00,61,00,61,00,61,00,00,00,62,00,62,00,62,00,62,00,62,00,62,00,62,\
- 00,62,00,62,00,62,00,62,00,00,00,63,00,63,00,63,00,63,00,63,00,63,00,63,00,\
- 63,00,63,00,63,00,63,00,63,00,00,00,00,00
- "multistr2"=hex(7):31,00,5c,00,30,00,5c,00,5c,00,00,00,32,00,32,00,32,00,5c,00,\
- 00,00,00,00
- [HKEY_LOCAL_MACHINE\SOFTWARE\TEST!ABC\~!@#$%^&*()_+|}{:"?><,./;'[]=-]
- "\\~!@#$%^&*()_+|}{:\"?><,./;'[]=-\\"="\\~!@#$%^&*()_+|}{:\"?><,./;'[]=-\\"
复制代码 |