[英]How to set value in registry via batch file in Windows?
I am going to set a value to windows registry. 我要为Windows注册表设置一个值。 I want to set variable
shit
for StupidMS
in registry, but the result is wrong. 我想在注册表中为
StupidMS
设置变量shit
,但结果是错误的。 Following is my code. 以下是我的代码。
set stupidMS=shit
echo %stupidMS%
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run" /v "StupidMS" /t REG_SZ /d ^%stupidMS^%
I think the problem is ^%stupidMS^% , but I quite have no idea how to correct it. 我认为问题是^%stupidMS ^% ,但我完全不知道如何纠正它。
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run" /v "StupidMS" /t REG_SZ /d "%stupidMS%"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.