我要为 Windows 注册表设置一个值。
我想在注册表中为 StupidMS
设置变量 shit
,但结果是错误的。以下是我的代码。
set stupidMS=shit
echo %stupidMS%
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run" /v "StupidMS" /t REG_SZ /d ^%stupidMS^%
我认为问题是 ^%stupidMS^%,但我完全不知道如何纠正它。
最佳答案
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run" /v "StupidMS" /t REG_SZ /d "%stupidMS%"
关于windows - 如何在 Windows 中通过批处理文件在注册表中设置值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17714652/