尝试编辑在Windows注册表使用批处理文件 [英] Trying to edit the registry in Windows with a batch file
问题描述
我支持全国各地的一些办事处运行Windows XP。他们是独立的,没有Windows Server或Active Directory中,类似的事情。我刚换他们交给谷歌企业应用套件,并在这个过程中替换的Windows Live Messenger与谷歌谈。我真的要被停止使用的Windows Live,该平台将这么多的垃圾邮件,似乎有很多漏洞。我已经测试进行注册表编辑关键
I am supporting a few offices across the country running Windows XP. They are stand alone, no Windows Server or Active Directory, anything like that. I just switched them over to Google Apps, and in the process replaced Windows Live Messenger with Google Talk. I really want to stop Windows Live from being used, the platform sends so much spam and seems to have a lot of holes. I have tested making a registry edit to key
HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun
添加一个字符串值 msnmsgr.exe
设置为 1
。我手工做的一台机器上,和它的工作,在两个配置文件,它不会启动Messenger的。我的成功后,我写的正是如此.reg文件:
adding a string value msnmsgr.exe
set to 1
. I did it manually on one machine, and it worked, under both profiles, it wouldn't start Messenger. After my success, I wrote a .REG file thusly:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun]
"msnmsgr.exe"="1"
和一个批处理文件,从同一目录中运行,这样写的:
And a batch file, run from the same directory, written like this:
@ECHO off
REGEDIT.EXE /S msn.reg
这似乎写入注册表,但现场已经开始。不知道发生了什么。看来这可能已经Serverfault和这里的任何一种方式,但我去这里既然政府似乎部分尚未解决的涉及很少的编程是不工作的。
It seems to write to the registry, but Live is starting. No idea what's happening. Seems this could have gone either way between Serverfault and here, but I went here since the Administration part seems resolved yet the little programming involved isn't working out.
在此先感谢的任何援助。
Thanks in advance for any assistance.
推荐答案
看起来像你对我有交换的注册表值名称和数据。按照知识库文章的REG_SZ值(S)应以数字命名从1,并且包含数据将可执行文件的名称(msnmsgr.exe)。因此,你的.reg文件应该是这样的:
Looks to me like you have the Registry value name and data swapped. According to the kb article, the REG_SZ value(s) should be named numerically starting with "1", and the included data would be the executable name ("msnmsgr.exe"). Thus, your .REG file should look like this:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun]
"1"="msnmsgr.exe"
另外,我建议你使用 REG.EXE 计划的简单编辑这个样子,而不是导入.reg文件。对于你想改变,你的REG.EXE命令是这样的:
Also, I would recommend that you use the REG.EXE program for simple edits like this, rather than importing a .REG file. For the change you wanted, your REG.EXE command would look like this:
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun" /v "1" /t REG_SZ /d "msnmsgr.exe" /f
这篇关于尝试编辑在Windows注册表使用批处理文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!