Jump to content

When Using Regread


Recommended Posts

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.

#)

Link to comment
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
Link to comment
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
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...