使用批处理文件修改注册表

时间:2015-08-25 17:43:34

标签: batch-file outlook registry

我想使用批处理文件修改注册表值。我知道如何使用.reg文件来完成它,但我需要使用批处理文件来完成它,因为批处理文件中还有更多命令。

所以,我想更改以下值:

[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\15.0\Outlook\Profiles\Outlook\9375CFF0413111d3B88A00104B2A6676\00000004]

"POP3 Server"=hex:31,00,39,00,32,00,2e,00,30,00,2e,00,30,00,2e,00,31,00,30,00,\
  30,00,00,00

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

您是否尝试修改POP3服务器名称?您不应该直接在注册表中执行此操作 -

  • 上面的“15”适用于Outlook 2013,因此没有其他版本的Outlook 工作
  • 上面的“Outlook”代表配置文件名称。如果用户具有不同的个人资料名称会怎样?
  • “9375CFF0413111d3B88A00104B2A6676”是配置文件部分GUID。每台机器都不同。
  • 4是帐户ID。在不同的机器上也有所不同。

您需要使用IOlkAccountManager API(仅限C ++或Delphi - 如果单击IOlkAccountManager按钮,则可以在OutlookSpy中查看数据)或Redemption(任何语言) - RDOPOPAccount对象显式公开POP3服务器名称:

 set Session = CreateObject("Redemption.RDOSession")
 Session.Logon("YourProfileName")
 set Accounts = Session.Accounts
 for each Account in Accounts
   if Account.AccountType = 0 Then 'atPOP3
     'MsgBox "POP3 server for account " & Account.Name & ": " & Account.POP3_Server
     if Account.POP3_Server = "server1.com" Then
       Account.POP3_Server = "server2.com"
       Account.Save
     End If
   end if 
 next