Sign in to follow this  
Followers 0
60aside

-1 error with _HexToString

2 posts in this topic

Merry Christmas everyone.

I have a small script I am working with to search the registry and find the location of the PST files in Outlook.

Here is the Script :-

#include <string.au3>

For $i= 1 to 1000
    $var = RegEnumKey("HKCU\SOFTWARE\MICROSOFT\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles", $i)
        If @error <> 0 then ExitLoop
    $sKeyPath = ("HKCU\SOFTWARE\MICROSOFT\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\" & $var)
    
    For $ii= 1 to 1000
    $sKey = RegEnumKey($sKeyPath, $ii)
        If @error <> 0 then ExitLoop
    
    For $iii = 1 to 1000
        $sEnumPath = $sKeyPath & "\" & $sKey
            $sKeyVal = RegEnumVal($sEnumPath, $iii)
        If @error <> 0 Then ExitLoop
            
        If $sKeyVal = "001f6700" Then
            
        $sRegVal = RegRead ($sEnumPath, $sKeyVal)
        
        $PST = _HexToString($sRegVal)
        msgbox(0,"Hex",$sRegVal)
        msgbox(0,"String",$PST)
        EndIf
        
Next
Next
Next

The problem is the HEX string retrieved looks fine and is correct, but when I use _HexToString it gives me a -1 value instead of

the location of the PST file.

Can anyone advise where this is going wrong?

Thanks.

Share this post


Link to post
Share on other sites



The above script is now working better since I installed Autoit v3.3.2.0, previously I was using v3.3.0.0

was this a bug in v3.3.0.0?

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  
Followers 0