Jump to content
Sign in to follow this  
ZacUSNYR

PST File Location

Recommended Posts

An easy method to analyze COM objects is described here ;) 


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2020-10-10 - Version 1.5.2.1) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2020-12-15 - Version 1.6.3.1) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2020-06-27 - Version 1.3.2.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki, WebDriver - Wiki

 

Share this post


Link to post
Share on other sites

In the Example Scripts forum you will find scripts that give a graphical output so you get a better overview.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2020-10-10 - Version 1.5.2.1) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2020-12-15 - Version 1.6.3.1) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2020-06-27 - Version 1.3.2.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki, WebDriver - Wiki

 

Share this post


Link to post
Share on other sites

Hello, I am going to Chime in on this and running Windows 10 should not matter, but fyi. The following script does not find anything yet I have 3 pst files mapped in Office 2013 and zero ost files

_OL_ConfigBackup.au3 from Water's outlook scripts. It throws an error code of 6 stating:

No profile with a registry subkey "9375CFF0413111d3B88A00104B2A6676" could be found

This script:

#include <OutlookEX.au3>
$oOL = _OL_Open()
$oNamespace = $oOL.GetNamespace("MAPI")
$oStore = $oNamespace.DefaultStore
ConsoleWrite($oStore.FilePath)
_OL_Close($oOL)

Only finds ONE of the 3 PST files I have mapped to '\Documents\Outlook Files\' the others are in custom locations in Office 2013 and Win10 config.

I created a script and it locates ALL pst file that are mapped in office versions 2007 through 2016. IF the PST has never been mapped then it will not grab it. It finds only valid PST files that correspond to the registry locations. I.E. that means IF someone 'closed' that PST in Outlook, for some reason I have noticed the old maps stick around in the registry and will show up. Reads each registry location and verifies that path has a valid PST file. I wrote in the simple way I know how and just works.

It will create a txt file with the information on the desktop, and will throw up an display when completed as well. It takes a second or two to run.

This has been tested on Windows 10 with Office 2103 pro and Windows 7 with Office 2016 pro, win7 pro with outlook 2013 and 2010 it will even locate and verify if the PST is located on a network drive as well.

#include <Array.au3>
#include <Date.au3>
#include <File.au3>

Local $s[15], $r[15], $ss[15], $rr[15]
For $i = 1 To 15
    $s[$i] = RegEnumVal("HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Outlook\Search\", $i)
    ;$x[$i][0] = $s[$i]
    If @error <> 0 Then ExitLoop
    If $s = "" Then
        ContinueLoop
    EndIf

Next

For $i = 1 To 15
    $r[$i] = RegEnumVal("HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Outlook\Search\", $i)
    ;$x[$i][1] = $r[$i]
    If @error <> 0 Then ExitLoop
    If $r = "" Then
        ContinueLoop
    EndIf
Next

For $i = 1 To 15
    $ss[$i] = RegEnumVal("HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Outlook\Search\", $i)
    ;$x[$i][0] = $ss[$i]
    If @error <> 0 Then ExitLoop
    If $ss = "" Then
        ContinueLoop
    EndIf

Next

For $i = 1 To 15
    $rr[$i] = RegEnumVal("HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Outlook\Search\", $i)
    ;$x[$i][1] = $rr[$i]
    If @error <> 0 Then ExitLoop
    If $rr = "" Then
        ContinueLoop
    EndIf
Next

_ArrayAdd($s, $r + $ss + $rr)

Local $aArrayUnique = _ArrayUnique($s) ; Use default parameters to create a unique array.
;_ArrayDisplay($aArrayUnique, "$aArray Unique") ; Display the unique array.
$zz = UBound($aArrayUnique) - 1
For $j = $zz To 1 Step -1
    If $aArrayUnique[$j] = "" or not FileExists($aArrayUnique[$j]) Then
        _ArrayDelete($aArrayUnique, $j)
    ElseIf FileExists($aArrayUnique[$j]) Then
        $aArrayUnique[$j] = $aArrayUnique[$j]
    Else
        ContinueLoop
    EndIf
Next
$ee = UBound($aArrayUnique) - 1
$aArrayUnique[0] = $ee

$sShortMonthName = _DateToMonth(@MON, $DMW_SHORTNAME)
$yr = @YEAR
$dy = @MDAY
$Snow = _NowTime(5)
$DT = $sShortMonthName & "_" & $dy & "_" & $yr & "," & $Snow
FileWrite(@DesktopDir & "\PstOst.txt", $DT & @CRLF & "File PST/OST file locations." & @CRLF & @CRLF)
For $t = 1 To UBound($aArrayUnique) - 1
    FileWrite(@DesktopDir & "\PstOst.txt", $aArrayUnique[$t] & @CRLF)
Next

_ArrayDisplay($aArrayUnique, "Outlook Current PST/OST", "0:" & $ee, 80)

FileWrite(@DesktopDir & "\PstOst.txt", @CRLF & @CRLF)
Exit

 

 

Edited by Carm01
clean up code

Share this post


Link to post
Share on other sites

I should remove _OL_ConfigBackup  from the UDF as it is only an unfinished example script.
But I'm glad you could create a script that fits your needs :)


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2020-10-10 - Version 1.5.2.1) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2020-12-15 - Version 1.6.3.1) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2020-06-27 - Version 1.3.2.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki, WebDriver - Wiki

 

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...