如何使用bat文件创建注册表项
需要使用bat文件创建注册表项。我可以使用命令提示符或bat文件创建注册表项吗?
这背后的主要目的是,我想使用bat文件创建环境变量。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
需要使用bat文件创建注册表项。我可以使用命令提示符或bat文件创建注册表项吗?
这背后的主要目的是,我想使用bat文件创建环境变量。
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(4)
您可以使用 Windows 内置命令行工具,
regedit.exe
或reg.exe
,请参阅:You can use the Windows built-in command line tools, either
regedit.exe
orreg.exe
, see:是的,您可以使用批处理文件创建注册表项,
这里是一个示例:
使用 .bat 文件禁用任务管理器:
启用任务管理器:
您可以通过输入 reg/? 来获取帮助?在命令提示符下的各种选项。
享受.........
Yes u can create Registry Key using Batch file
here is an example:
for disabling task manager using .bat file:
for enabling task manager:
You can take Help by entering reg/? in command prompt for various options.
Enjoy.........
设置变量=字符串
SET variable=string
如果您想创建一个持久环境变量(即不仅适用于当前会话的变量),您可以使用
setx
。如果有程序可以为您完成此操作,则无需直接修改注册表:If you want to create a persistent environment variable (i.e. one that not only applies to the current session) you can use
setx
. No need to mess around with the registry directly if there is a program to do it for you: