samuria Posted December 20, 2009 Share Posted December 20, 2009 I am trying to read write delete from the registery specifically from HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RUN I cant get it to work can any give me a bit of code to get me started? If I know the keys I can do it but I want to write software that will find what is there and display it and then optionally edit it\delete it Link to comment Share on other sites More sharing options...
danielkza Posted December 20, 2009 Share Posted December 20, 2009 Did you even look at the help file? Searching for 'registry' returns RegRead as the first result. Link to comment Share on other sites More sharing options...
samuria Posted December 20, 2009 Author Share Posted December 20, 2009 I found the help but couldnt get it to work if I didnt know what was there ie if I knew there was one winpatrol I could read the value but if i didnt know the list that was there i couldnt work it out as I am knew to this Link to comment Share on other sites More sharing options...
danielkza Posted December 20, 2009 Share Posted December 20, 2009 I found the help but couldnt get it to work if I didnt know what was there ie if I knew there was one winpatrol I could read the value but if i didnt know the list that was there i couldnt work it out as I am knew to thisAre you not familiar with search boxes? Doesn't get easier than that. Link to comment Share on other sites More sharing options...
failedtocompile Posted December 20, 2009 Share Posted December 20, 2009 (edited) I think what danielkza is trying to say is, you need to show some active interest/investment which you will need show, as almost everyone in this community has and it will benefit you in the long run. Here is an example $regR1 = RegRead( "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RUN", "StartCCC" ) msgbox(0, "", "Reading from Registry:" & @CRLF & $regR1) the first part is the actual reg key/path the last part "StartCCC" is the actually key value that you see on the left hand pane of the registry editor. Taken from the Helpfile: RegRead -------------------------------------------------------------------------------- Reads a value from the registry. RegRead ( "keyname", "valuename" ) Parameters keyname The registry key to read. valuename The value to read. Return Value Success: Returns the requested registry value. @EXTENDED is set to the type of the value $REG_... . These types are defined in the "Constants.au3" include file. Failure: Returns "" and sets the @error flag: 1 if unable to open requested key 2 if unable to open requested main key 3 if unable to remote connect to the registry -1 if unable to open requested value -2 if value type not supported Remarks A registry key must start with "HKEY_LOCAL_MACHINE" ("HKLM") or "HKEY_USERS" ("HKU") or "HKEY_CURRENT_USER" ("HKCU") or "HKEY_CLASSES_ROOT" ("HKCR") or "HKEY_CURRENT_CONFIG" ("HKCC"). And then there is Regwrite, most of all the examples in the helpfile are practical and can be altered to suit what you may require at a base level. ftc Edited December 20, 2009 by failedtocompile Link to comment Share on other sites More sharing options...
samuria Posted December 20, 2009 Author Share Posted December 20, 2009 The above code just gives a msgbox that saya reading register it doesnt give any values Link to comment Share on other sites More sharing options...
MirnesC2 Posted December 20, 2009 Share Posted December 20, 2009 #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $check = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\RegEdit Test", "RegGroup") $reg = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\RegEdit Test", "RegGroup") If $check = "" Then RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\RegEdit Test", "RegGroup", "REG_SZ", "This is from REG") EndIf $RegEdit = GUICreate("RegEdit", 184, 43, 192, 124) $Input1 = GUICtrlCreateInput($reg, 8, 10, 89, 21) $Save = GUICtrlCreateButton("Save", 105, 7, 65, 25, $WS_GROUP) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Save RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\RegEdit Test", "RegGroup", "REG_SZ", GUICtrlRead($Input1)) EndSwitch WEnd Link to comment Share on other sites More sharing options...
omikron48 Posted December 21, 2009 Share Posted December 21, 2009 Or you can use "reg.exe query <keyname>" and output the results to a file or msgbox to view the contents or the registry. 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