gpt4 book ai didi

windows - REG 添加一个 REG_MULTI_SZ 多行注册表值

转载 作者:可可西里 更新时间:2023-11-01 14:38:35 28 4
gpt4 key购买 nike

要添加一个 REG_MULTI_SZ 多行注册表值,我可以这样做

reg.exe ADD "HKLM\path\to\registry\key" /v RegistryValue /t REG_MULTI_SZ /d "abc\0def\0"

这将添加 ("abc", "def")。

但是如果我需要添加 ("abc", "", "def"),即中间的一个空项目怎么办?

reg.exe ADD "HKLM\path\to\registry\key" /v RegistryValue /t REG_MULTI_SZ /d "abc\0\0def\0"

给我一​​个“无效参数”错误。

最佳答案

这对我有用:

REG ADD "HKLM\LOCATION" /v "Value" /t REG_MULTI_SZ /d item1\0item2 /f

或者如果您的项目有空格:

REG ADD "HKLM\LOCATION" /v "Value" /t REG_MULTI_SZ /d "item1"\0"item2" /f

确保你没有两个尾随“\0”分隔符(一个是可以的,有或没有尾随\0 你都会得到你的最后一个返回字符)如下例(就像我在 TechNet 文章中看到的那样) ,否则您将收到“错误:为‘/d’指定的值无效。”:

REG ADD "HKLM\LOCATION" /v "Value" /t REG_MULTI_SZ /d item1\0item2\0\0 /f

关于windows - REG 添加一个 REG_MULTI_SZ 多行注册表值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8853911/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com