如何设置通过批处理文件中的注册表值在Windows? [英] How to set value in registry via batch file in Windows?

查看:153
本文介绍了如何设置通过批处理文件中的注册表值在Windows?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要设置一个值Windows注册表。
我想设置变量狗屎 StupidMS 在注册表中,但结果是错误的。以下是我的code。

 集stupidMS =狗屎
回声%stupidMS%REG ADDHKEY_CURRENT_USER \\软件\\微软\\的Windows \\ CurrentVersion \\ Run中/ VStupidMS/吨REG_SZ / d的^%^ stupidMS%

我认为这个问题是的 ^%^ stupidMS%,但我挺不知道如何纠正它。


解决方案

  REG ADDHKEY_CURRENT_USER \\软件\\微软\\的Windows \\ CurrentVersion \\ Run中/ VStupidMS/吨REG_SZ / D%stupidMS%

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.

解决方案

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

这篇关于如何设置通过批处理文件中的注册表值在Windows?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆