Sign in to follow this  
Followers 0
jujubois

Personal files path Outlook

6 posts in this topic

Good morning

Sorry for my English because I'm french.

I try to retrieve the path where the file is stored PST of the current user.

Register: HKEY_CURRENT_USER \ Software \ Microsoft \ Windows NT \ CurrentVersion \ Windows Messaging Subsystem \ Profiles \ Outlook

I found a code Delphi and I want to convert to au3! can you help me

Thank you

function GetOutlookArchiveList: tStrings;
var
  Reg : TRegistry;
  RegInfo : TRegDataInfo;
  Buffer : array of Char;
  BufferSize : Integer;
  I,J:Integer;
  KeyList : TStrings;
  Value : string;
const
  OutlookReg : string = 'Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\Outlook';
begin
  Result := TStringList.Create;
  KeyList := TStringList.Create;
  Reg := TRegistry.Create;
  Reg.RootKey := HKEY_CURRENT_USER;
  Reg.OpenKey(OutlookReg,false);
  Reg.GetKeyNames(KeyList);
  Reg.CloseKey;
  For i:=0 to KeyList.Count - 1 do
  begin
       Reg.OpenKey(OutlookReg + '\' + KeyList.Strings[i],false);
       if Reg.ValueExists('001f6700') then
       begin
            Value := '';
            BufferSize := Reg.GetDataSize('001f6700');
            SetLength(Buffer,BufferSize);
            Reg.ReadBinaryData('001f6700',Buffer[0],BufferSize);
            For j:=0 to BufferSize - 1 do
            begin
                 if Buffer[j] <> #0 then
                    Value := Value + Buffer[j];
            end;
            Result.Add(Value);          
       end;
       Reg.CloseKey;
  end;
  Reg.Free;
end;

Share this post


Link to post
Share on other sites



Yes, I would like to locate the folder where the files are stored Outlook of the current user

Share this post


Link to post
Share on other sites

@jujubois

Maybe this can get you going.

$sKeyPath = "HKEY_CURRENT_USER\SOFTWARE\MICROSOFT\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\Outlook"
For $i= 1 to 50
    $sKey = RegEnumKey($sKeyPath, $i)
        If @error <> 0 then ExitLoop
    For $ii = 1 to 100
        $sEnumPath = $sKeyPath & "\" & $sKey
        ; ConsoleWrite($sEnumPath & @LF)
            $sKeyVal = RegEnumVal($sEnumPath, $ii)

        If @error <> 0 Then ExitLoop
        ; ConsoleWrite("Value Name  #" & $ii & " under in  key " & $sKeyVal & @LF)
        $sRegVal = RegRead ($sEnumPath, $sKeyVal)
            If Bitor(StringRight($sRegVal,4) = ".PST", StringRight($sRegVal,4) = ".OST") then
                ConsoleWrite("SubKey #" & $i & " under HKCU: " & $sKey & @LF)
                ConsoleWrite("PST PATH : " & $sRegVal & @LF)
            EndIf
    next
Next

regards,

ptrex

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

You also may want to review the Registry management functions in the helpfile. I don't have much experience in pulling registry stuff with a autoit script, but I think you may find more stuff here:

http://www.autoitscript.com/forum/index.ph...amp;hl=registry

http://www.autoitscript.com/forum/index.ph...amp;hl=registry

http://www.autoitscript.com/forum/index.ph...amp;hl=registry

http://www.autoitscript.com/forum/index.ph...amp;hl=registry

http://www.autoitscript.com/forum/index.ph...amp;hl=registry

http://www.autoitscript.com/forum/index.ph...amp;hl=registry

http://www.autoitscript.com/forum/index.ph...amp;hl=registry

http://www.autoitscript.com/forum/index.ph...amp;hl=registry

Each one is a seperate thread with examples or tools folks have built.

In looking at all the stuff, this should give you what you need to put together the code you want. Hope this helps.

Edited by Volly

Share this post


Link to post
Share on other sites

Thank you for your help

I can get some information but not what I want to ... do you know how to find the path where typing in the register

;Script starting

#include <String.au3>

$var1=RegRead ( "HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\Outlook\9375CFF0413111d3B88A00104B2A6676", "{ED475418-B0D6-11D2-8C3B-00104B2A6676}")

$var2=StringLeft ( $var1, 2)

; set default profile registry path

$var3="000000"&$var2

; read registry key & value "Email"

$var4=RegRead ( "HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\Outlook\9375CFF0413111d3B88A00104B2A6676\"&$var3, "Email")

$var5= StringRegExpReplace ($var4,"00","")

; convert hexa string to ascii

$var6= _HexToString ($var5)

$emailaddress=$var6

$Pop3Server=RegRead ( "HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\Outlook\9375CFF0413111d3B88A00104B2A6676\"&$var3, "POP3 Server")
$Pop3Server= StringRegExpReplace ($Pop3Server,"00","")
$Pop3Server= _HexToString ($Pop3Server)


$ImapServer=RegRead ( "HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\Outlook\9375CFF0413111d3B88A00104B2A6676\"&$var3, "IMAP Server")
$ImapServer= StringRegExpReplace ($ImapServer,"00","")
$ImapServer= _HexToString ($ImapServer)


If $Pop3Server = "" Then
$Pop3Server="Unused"
EndIf

If $ImapServer= "" Then
$ImapServer="Unused"
EndIf

MsgBox(0, "Account settings", $emailaddress & @CRLF & "POP3 Server =" & $Pop3Server & @CRLF & "Imap Server =" & $ImapServer)

;Script end

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0