帮助创建一个reg脚本 [英] Help with creating a reg script

查看:182
本文介绍了帮助创建一个reg脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现此脚本在MSOffice 2010中更改用户名。我的sysprep图像的用户名错误。每次创建新的用户配置文件时,它都会分配错误的用户名。我将其复制到文本文件并重命名为user.reg。我无法让脚本运行。我收到指定的文件不是注册表脚本。您只能从注册表编辑器中导入二进制注册表文件。



reg add HKEY_CURRENT_USER \Software \ MicroSoft \ Office \ Common \ UserInfo / v username / t reg_sz / d%username%/ f



任何帮助都将不胜感激。

解决方案

reg 是命令提示符命令。当你打电话给 reg add 时,你应该从cmd调用它。因此,最简单的解决方案是将代码放在带有.bat或.cmd扩展名的文件中。创建一个扩展名为.bat或.cmd的空文件并复制并粘贴

你的命令:



 reg add HKEY_CURRENT_USER \Software \ Mysoftoft \Office\Common\UserInfo / v username / t reg_sz / d%username%/ f 





BTW,如果你真的想使用注册表编辑器脚本(扩展名为.reg的文件),那么改变文件格式如下:

 Windows注册表编辑器版本5.00 

[HKEY_CURRENT_USER \Software\Microsoft\Office\Common\UserInfo]
username=xxxxxxxx



使用此选项,您将无法传递环境变量。您必须准备文件内容以填充.reg文件中的值

I found this script to change username in MSOffice 2010. I have a sysprep image with the wrong username. Each time a new user profile is created it assigns the wrong username. I copied it to a text file and renamed is user.reg. I cannot get the script to run. I’m getting "The specified file is not a registry script. You can only import a binary registry files from within the registry editor."

reg add HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo /v username /t reg_sz /d %username% /f

Any help would be appreciated.

解决方案

reg is a Command Prompt command. When you call reg add you are supposed to call it from cmd. Therefore, the easiest solution for you is to put your code to a file with and extension of .bat or .cmd. Create an empty file with .bat or .cmd extension and copy and paste
your command there:

reg add HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo /v username /t reg_sz /d %username% /f



BTW, if you really want to use a registry editor script (files with an extension of .reg) then change the file format like this:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Office\Common\UserInfo]
"username"="xxxxxxxx"


By using this option you will not be able to pass Environment Variables. You will have to prepare the file content to populate the value in the .reg file


这篇关于帮助创建一个reg脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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