windows - 如何在 Windows 中通过批处理文件在注册表中设置值?

标签 windows batch-file registry

我要为 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/

相关文章:

Python 2.6 - 我无法使用 _winreg.SetValueEx() 将大于 0x7fffffff 的双字写入注册表

windows - 从UNIX到Windows的FTP时如何检查远程服务器上目录的存在

c - Windows 上带有 DLL 的动态模块

php - memcached.dll 是否存在?

windows - 使用 Powershell 实现 IE 自动化

c# - 找到最低的子文件夹并压缩它们

batch-file - 如何从 cmd 向 stderr 发送消息?

windows - 使用 REG ADD 将 %~DP0 写入注册表

vb6 - 访问 Project > References 窗口时出错?

winapi - 从 Haskell 访问 64 位注册表