ChrisL Posted April 19, 2006 Posted April 19, 2006 When using regread how to you turn a REG_BINARY result into a readable string? Is there a function that I just can not see? Ta [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire
nfwu Posted April 19, 2006 Posted April 19, 2006 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 ValueReturns string upon success. Returns -1 and sets @error to 1 upon failure.#) TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode()
ChrisL Posted April 19, 2006 Author Posted April 19, 2006 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 [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire
PsaltyDS Posted April 19, 2006 Posted April 19, 2006 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". 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
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