Sign in to follow this  
Followers 0
ChrisL

When Using Regread

4 posts in this topic




AutoIt Help File:

When reading a REG_BINARY key the result is a string of hex characters, e.g. the REG_BINARY value of 01,a9,ff,77 will be read as the string "01A9FF77".

If you want to convert Hex into a string, use this UDF:

_HexToString

--------------------------------------------------------------------------------

Convert a hex string to a string.

#include <string.au3>

_HexToString("hex")

Parameters

$strHex

Return Value

Returns string upon success. Returns -1 and sets @error to 1 upon failure.

#)

Share this post


Link to post
Share on other sites

AutoIt Help File:

If you want to convert Hex into a string, use this UDF:

#)

Thanks.. if your interested this is what I did.

It looks for a Plextore drive and works!

#include <string.au3>

For $i = 67 to 90
$cdWriter = RegRead ("HKEY_LOCAL_MACHINE\System\MountedDevices", "\DosDevices\" & Chr ($i) & ":")
;MsgBox (0,"\DosDevices\" & Chr ($i) & ":",_HexToString(StringReplace ($cdWriter, "00", "")));debug
If StringInStr (_HexToString(StringReplace ($cdWriter, "00", "")), "PLEXTOR") <> 0 then MsgBox (0,"CD Writer", "Writer is detected as " &Chr ($i) & ":")
Next

Share this post


Link to post
Share on other sites

Thanks.. if your interested this is what I did.

It looks for a Plextore drive and works!

#include <string.au3>

For $i = 67 to 90
$cdWriter = RegRead ("HKEY_LOCAL_MACHINE\System\MountedDevices", "\DosDevices\" & Chr ($i) & ":")
;MsgBox (0,"\DosDevices\" & Chr ($i) & ":",_HexToString(StringReplace ($cdWriter, "00", "")));debug
If StringInStr (_HexToString(StringReplace ($cdWriter, "00", "")), "PLEXTOR") <> 0 then MsgBox (0,"CD Writer", "Writer is detected as " &Chr ($i) & ":")
Next
Just for trivia's sake, since it works the way it is: I don't think you need to include the backslashes on the Value name "DosDevices".

:think:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

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