How to set value in registry via batch file in Windows?

我怕爱的太早我们不能终老 提交于 2020-01-03 09:08:54

问题


I am going to set a value to windows registry. I want to set variable shit for StupidMS in registry, but the result is wrong. 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.


回答1:


reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run" /v "StupidMS" /t REG_SZ /d "%stupidMS%"


来源:https://stackoverflow.com/questions/17714652/how-to-set-value-in-registry-via-batch-file-in-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!