jujubois Posted June 6, 2008 Share Posted June 6, 2008 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 expandcollapse popupfunction 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; Link to comment Share on other sites More sharing options...
Bert Posted June 6, 2008 Share Posted June 6, 2008 Take a look at the following in the helpfile: Regread do..until while It is pretty strait forward to make what you need. I take it you need a list of all the PST files for the current user. Am I correct on this? The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
jujubois Posted June 6, 2008 Author Share Posted June 6, 2008 Yes, I would like to locate the folder where the files are stored Outlook of the current user Link to comment Share on other sites More sharing options...
ptrex Posted June 6, 2008 Share Posted June 6, 2008 @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 Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
Bert Posted June 6, 2008 Share Posted June 6, 2008 (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=registryhttp://www.autoitscript.com/forum/index.ph...amp;hl=registryhttp://www.autoitscript.com/forum/index.ph...amp;hl=registryhttp://www.autoitscript.com/forum/index.ph...amp;hl=registryhttp://www.autoitscript.com/forum/index.ph...amp;hl=registryhttp://www.autoitscript.com/forum/index.ph...amp;hl=registryhttp://www.autoitscript.com/forum/index.ph...amp;hl=registryhttp://www.autoitscript.com/forum/index.ph...amp;hl=registryEach 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 June 6, 2008 by Volly The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
jujubois Posted June 6, 2008 Author Share Posted June 6, 2008 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 expandcollapse popup;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 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now