Eric Legault said:
HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows
Messaging Subsystem\Profiles\<profile
name>\0a0d020000000000c000000000000046\001f041a
It's binary, so you have to convert it in your code (a royal pain in the
ass).
It is actually stored in UNICODE and fairly simple to retrieve. The
following snippet shows how to read it with VBScript and Windows Scripting
Host (watch the line breaks):
Set objWSHShell = CreateObject("WScript.Shell")
varJunkMail = Array()
intCounter = 0
bstrJunkMailList = ""
strProfileName = "PST"
strRegValue = "HKEY_CURRENT_USER\Software\Microsoft\Windows
NT\CurrentVersion\Windows Messaging Subsystem\Profiles\" & strProfileName &
"\0a0d020000000000c000000000000046\001f0419"
bstrJunkMailList = objWSHShell.RegRead(strRegValue)
If UBound(bstrJunkMailList) <> 0 Then
For intCounter = LBound(bstrJunkMailList) To UBound(bstrJunkMailList)
If Hex(bstrJunkMailList(intCounter)) <> 0 Then
strJunkMailList = strJunkMailList & Chr(bstrJunkMailList(intCounter))
Else
strJunkMailList = strJunkMailList & " "
End If
strJunkMailList = Left(strJunkMailList, InStr(1, strJunkMailList, " ") -
1)
strJunkMailList = Replace(strJunkMailList, " ", "")
Next
End If
varJunkMail = Split(strJunkMailList, ";")
For intCounter = LBound(varJunkMail) To UBound(varJunkMail)
If Trim(varJunkMail(intCounter)) <> "" Then
WScript.Echo varJunkMail(intCounter)
End If
Next
Since Microsoft is obvisouly moving to store anything in UNICODE (thanks
God!) the same code can be used for a variety of tasks. The snippet above is
actually cut & paste out of a piece to read the Outlook 2002/2003 master
categories list I did a bunch of years ago when I played with them the first
time and just the registry key has been changed.
No big deal at all...