egistry key to find pst locations?

本文介绍了如何使用IProfAdmin接口及Extended MAPI从注册表中获取PST文件的位置信息,并提供了VB脚本示例来遍历所有配置文件并打印出对应的PST路径。

The PST file locations are stored in the profile sections in the registry. The officially supported API designed to access and manipulate the profile data is the IProfAdmin interface (you can play with it in OutlookSpy if you click the IProfAdmin button). PST path is stored in the PR_PST_PATH property. Extended MAPI can only be accessed from C++ or Delphi.

You can use ProfMan (it comes with the distributable version of Redemption); ProfMan can be used from any language. The following script (VB) retrieves PST files names from all local profiles:

'Print the path to all the PST files in all profiles
 PR_PST_PATH = &H6700001E

 set Profiles=CreateObject("ProfMan.Profiles")
 for i = 1 to Profiles.Count
   set Profile = Profiles.Item(i)
   set Services = Profile.Services
   Debug.Print "------ Profile: " & Profile.Name & " ------"
   for j = 1 to Services.Count
     set Service = Services.Item(j)
     If (Service.ServiceName = "MSPST MS") or (Service.ServiceName = "MSUPST MS") Then
      MsgBox Service.Providers.Item(1).ProfSect.Item(PR_PST_PATH)
     End If
   next
 next

You can also retrieve PST file names from PST stores using the Outlook Object Model (but that requires Outlook to be running, and you can only do that for the currently used profile) - use the Store.FilePath property:

set vApp = CreateObject("Outlook.Application")
for each vStore in vApp.Session.Stores
  MsgBox vStore.DisplayName & " - " & vStore.FilePath
next

来源 https://stackoverflow.com/questions/23800571/registry-key-to-find-pst-locations

转载于:https://www.cnblogs.com/ejin/p/7110136.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值