Jump to content
Sign in to follow this  

Outlook attachment folder

Recommended Posts


Users sometimes save an attachment without changing the directory. Since the Outlook attachment folder is different for each profile (unless it's been changed via the registry), and users don't ususally pay attention when performing such actions, I figured we could use a way to find them easily.

The script below finds the folder and opens an Explorer window to it.

I've only tested on XP SP2 and Vista.

Compatible with Office XP\2002, 2003, 2007

#cs ----------------------------------------------------------------------------

 AutoIt Version: (beta)
 Author:         Steven Bradham 11/21/2007

 Script Function:
    Find Outlook Attachments that were saved to a users Outlook
    temp folder.
    Compatible with Office XP\2002, 2003, 2007
#ce ----------------------------------------------------------------------------

Dim $Keypth[3], $Val, $ValRD, $i, $a

$KeyPth[0] = ("HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Outlook\Security")
$KeyPth[1] = ("HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Security")
$KeyPth[2] = ("HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Outlook\Security")

For $i = 0 to 2
$a = 1
    For $a = 1 to 100
    $Val = RegEnumVal($KeyPth[$i], $a)
    If @error <> 0 Then ExitLoop
    If $Val = ("OutlookSecureTempFolder") Then
        $ValRD = RegRead($KeyPth[$i], $Val)
        ShellExecute(@WindowsDir & "\explorer.exe", $ValRD)     
        If @error <> 0 Then ExitLoop

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