LOULOU Posted November 15, 2005 Share Posted November 15, 2005 (edited) #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 November 15, 2005 by LOULOU Link to comment Share on other sites More sharing options...
jpm Posted November 15, 2005 Share Posted November 15, 2005 #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 answerWhat 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 Link to comment Share on other sites More sharing options...
LOULOU Posted November 15, 2005 Author Share Posted November 15, 2005 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 Thanks JPM Now i understand your answer Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now