Jump to content

JPM Following of my question about Regread


LOULOU
 Share

Recommended Posts

#include <String.au3>
$usb = DriveGetDrive( "REMOVABLE" )
If NOT @error Then
     For $i = 1 to $usb[0]
        $usbdev = RegRead("HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices", "\DosDevices\" & StringUpper($usb[$i]))
$usbrealdev = _HexToString($usbdev)
If StringInStr ( $usbrealdev, "STORAGE#RemovableMedia#" ) then
     If DriveGetFileSystem ( $usb[$i] ) <> "NTFS" then MsgBox(0,"USB-Drive", $usb[$i])
    Endif
    Next

$usbrealdev must receive the entire key transform in String with _hexString in fact because of what is reading by regread with binary type it return only the first digits of the key because after the first digits there is a 00 value which means end of string

My question in fact was Is Regread functionning well with a reg_binary type because when i want to read the entire var i am obliged to supress each pair of "00"

I dont'know if this is a bug or not . Thanks JPM for your answer

Edited by LOULOU
Link to comment
Share on other sites

#include <String.au3>
$usb = DriveGetDrive( "REMOVABLE" )
If NOT @error Then
     For $i = 1 to $usb[0]
        $usbdev = RegRead("HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices", "\DosDevices\" & StringUpper($usb[$i]))
$usbrealdev = _HexToString($usbdev)
If StringInStr ( $usbrealdev, "STORAGE#RemovableMedia#" ) then
     If DriveGetFileSystem ( $usb[$i] ) <> "NTFS" then MsgBox(0,"USB-Drive", $usb[$i])
    Endif
    Next

$usbrealdev must receive the entire key transform in String with _hexString in fact because of what is reading by regread with binary type it return only the first digits of the key because after the first digits there is a 00 value which means end of string

My question in fact was Is Regread functionning well with a reg_binary type because when i want to read the entire var i am obliged to supress each pair of "00"

I dont'know if this is a bug or not . Thanks JPM for your answer

What you see is not what you have.

Check if the return string is not a binarystring (isbinaryString())

is so use String() to convert it back to a displayable info.

in your case what you really need in a _ConvUnicodeToAnsi UDF

B)

Link to comment
Share on other sites

What you see is not what you have.

Check if the return string is not a binarystring (isbinaryString())

is so use String() to convert it back to a displayable info.

in your case what you really need in a _ConvUnicodeToAnsi UDF

B)

Thanks JPM Now i understand your answer
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...