Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Location of personal folder in Outlook with VBS

Reply
 
Old 10-09-2008   #1 (permalink)
Tora


 
 

Location of personal folder in Outlook with VBS

Hello,

how can I check the location, size etc. of the ost and pst-files of the
personal folders of the current Outlook profile (script)?

Please help, thanks in advance

Bye
Tora

My System SpecsSystem Spec
Old 10-09-2008   #2 (permalink)
James Whitlow


 
 

Re: Location of personal folder in Outlook with VBS

"Tora" <alpha74@xxxxxx> wrote in message
news:%23UgSGAeKJHA.5704@xxxxxx
Quote:

> Hello,
>
> how can I check the location, size etc. of the ost and pst-files of the
> personal folders of the current Outlook profile (script)?
You could use the below for PST. I cannot seem to find a registry
location for OST. Perhaps an Outlook expert will come along with this
information. If you have Outlook installed and want to use it to reveal the
paths, you can use the code in this message (watch for wrapping):

http://groups.google.com/group/micro...935637cdfa765e

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Option Explicit

Const HKCU = &H80000001
Dim oFSO, oReg, sWMSS, sDefProf, aKeys
Dim sKey, aVal, sPSTPath, sPSTSize

'<*> Create WMI Registry Object
Set oReg = GetObject("winmgmts:\\.\root\default:StdRegProv")
Set oFSO = CreateObject("Scripting.FileSystemObject")

'<*> Find current user's default profile
sWMSS = "Software\Microsoft\Windows NT\Current" _
& "Version\Windows Messaging Subsystem\Profiles"
oReg.GetStringValue HKCU, sWMSS, "DefaultProfile", sDefProf
sDefProf = sWMSS & "\" & sDefProf

'Enumerate the default profile registry folder
oReg.EnumKey HKCU, sDefProf, aKeys

'<*> Walk the array of keys looking for 'Personal Folders'
For Each sKey in aKeys
oReg.GetBinaryValue HKCU,sDefProf & "\" & sKey, "001f3006", aVal
If VarType(aVal) And 8192 Then
If Bin2Str(aVal) = "Personal Folders" Then
oReg.GetBinaryValue HKCU,sDefProf & "\" & sKey, "001f6700", aVal
sPSTPath = Bin2Str(aVal)
'<*> If the PST file exists, get it's size
If oFSO.FileExists(sPSTPath) Then
sPSTSize = oFSO.GetFile(sPSTPath).Size
Else
sPSTSize = 0
End If
MsgBox "Path: " & sPSTPath & vbCr & "Size: " & sPSTSize
End If
End If
Next

Function Bin2Str(ByVal aBin)
Dim iChr
For Each iChr in aBin
If iChr Then Bin2Str = Bin2Str & Chr(iChr)
Next
End Function
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Outlook 2003 - Outlook personal Folders Backup Vista mail
Personal User Shell Folders - Move Location Tutorials
Moving personal folder from Outlook to WLM? Live Mail
Adding 'Location' tab to new folders in personal folder? Vista file management
Can You Move User Personal Folders to a Network Location Vista networking & sharing


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46