AZJIO Posted February 1, 2012 Share Posted February 1, 2012 RegistryViewer with use _RegFunc.au3 My other projects or all Link to comment Share on other sites More sharing options...
JFX Posted February 2, 2012 Share Posted February 2, 2012 In v2.0.6 _RegExport saves REG_MULTI_SZ in string form, but it needs to be binary data. Link to comment Share on other sites More sharing options...
wraithdu Posted February 2, 2012 Author Share Posted February 2, 2012 Dammit... I knew that change was gonna break something... grrrr, I'll have a fix up shortly. Link to comment Share on other sites More sharing options...
wraithdu Posted February 2, 2012 Author Share Posted February 2, 2012 Ok, fixed. Link to comment Share on other sites More sharing options...
highend Posted February 2, 2012 Share Posted February 2, 2012 Does v2.0.7 already support an export of multiple (not nested) keys into one file? Link to comment Share on other sites More sharing options...
wraithdu Posted February 2, 2012 Author Share Posted February 2, 2012 No, not yet. Link to comment Share on other sites More sharing options...
JFX Posted February 2, 2012 Share Posted February 2, 2012 @wraithdu Thanks for update looks perfect now. RegistryViewer with use _RegFunc.au3 Great! Icon index changed in win7, unsure about vista: IF @OSBuild < 5000 Then _GUIImageList_AddIcon($hImage, @WindowsDir&'\regedit.exe', 7) _GUIImageList_AddIcon($hImage, @WindowsDir&'\regedit.exe', 8) Else _GUIImageList_AddIcon($hImage, @WindowsDir&'\regedit.exe', 3) _GUIImageList_AddIcon($hImage, @WindowsDir&'\regedit.exe', 4) EndIf Link to comment Share on other sites More sharing options...
step887 Posted February 8, 2012 Share Posted February 8, 2012 (edited) RegistryViewer with use _RegFunc.au3That is awesome... wraithdu, I found another issue .... I think you may end up hating me...... On win 7 64 bit (and 2008 according to the link below) _regread on HKEY_CLASSES_ROOT64CLSID is not finding anything.. @error is 1 -- invalid root key..HKEY_CLASSES_ROOTCLSID does not work.. Everything else under ROOT seems ok with HKEY_CLASSES_ROOThttp://msdn.microsoft.com/en-us/library/aa384253(v=vs.85).aspxHKEY_CLASSES_ROOT is a merged view of HKEY_LOCAL_MACHINESOFTWAREClasses and HKEY_CURRENT_USERSOFTWAREClasses. Redirected keys in these registry paths are effectively redirected for HKEY_CLASSES_ROOT also. This is also true for reflected keys on systems that support them.I can read correctly if I am going under "HKEY_LOCAL_MACHINE64SOFTWAREClassesCLSID" and since it reflects to ROOT, i guess that is ok Edited February 8, 2012 by step887 Link to comment Share on other sites More sharing options...
JFX Posted February 8, 2012 Share Posted February 8, 2012 @error is 1 -- invalid root key.. Error is easy to understand, the root key is missing inside _RegOpenKey() function Case "HKEY_CLASSES_ROOT64", "HKCR64" $hRoot = $HKEY_CLASSES_ROOT $iAccess = BitOR($iAccess, $KEY_WOW64_64KEY) $iView = $KEY_WOW64_64KEY Link to comment Share on other sites More sharing options...
wraithdu Posted February 8, 2012 Author Share Posted February 8, 2012 (edited) @step887 JFX is correct. I'm sure I left that out for a reason, however I can add it in with the next update... buyer beware. If you want to add in JFX's fix for now, go ahead, but also add the HKCR32 spec. Edited February 8, 2012 by wraithdu Link to comment Share on other sites More sharing options...
step887 Posted April 19, 2012 Share Posted April 19, 2012 (edited) Wraithdu, Been using this all this time and it is solid. Found another issue/judgement call.. _regkeyexists and _regvalueexists was returning 0 if the registry key was there, but there was a permission issue. _regread is returning @error = 2 - Failed to open source key (@extended contains RegOpenKeyExW return value) @extended = 5 (ERROR_ACCESS_DENIED) I modified both functions to: _RegRead($s_key, "") ; try to read default value $error = @error $extended = @extended If $error = 2 And $extended = 5 Then Return SetError(0, $extended, 2) Switch $error Case 1, 2 ; invalid root key | failed to open key Return SetError($error, $extended, 0) Case Else ; key exists Return SetError(0, 0, 1) EndSwitch The only reason I used $error and $extended was there was an issue with the script when it was Obfuscated and I used @error and @extended. Edited April 19, 2012 by step887 Link to comment Share on other sites More sharing options...
AZJIO Posted May 21, 2012 Share Posted May 21, 2012 Will export the registry to a variable?link_Ru My other projects or all Link to comment Share on other sites More sharing options...
wraithdu Posted May 21, 2012 Author Share Posted May 21, 2012 Will export the registry to a variable?link_RuNot directly... don't much see the point in it. You could write a simple wrapper though that exports to a temp file, FileRead into a variable, then delete the temp file. Link to comment Share on other sites More sharing options...
AZJIO Posted May 21, 2012 Share Posted May 21, 2012 (edited) I tried to make himself - _RegExportToDataIf (Not IsArray($ret)) Or ($ret[0] <> 0) Then If IsArray($ret) Then Return SetError(3, $ret[0], 0) Else Return SetError(3, 0, 0) EndIf EndIfreplace itIf IsArray($ret) Then If $ret[0] <> 0 Then Return SetError(3, $ret[0], 0) Else Return SetError(3, 0, 0) EndIf Edited April 14, 2013 by AZJIO My other projects or all Link to comment Share on other sites More sharing options...
Iczer Posted January 8, 2014 Share Posted January 8, 2014 (edited) it seems RegCopyValue() and _RegWrite() errorour on 3.3.10.2 while working ok on 3.3.8.1 i'm trying to copy default reg value from one key to another with: _RegCopyValue( $copy_From, "", $copy_To, "" ) but get @error = 3 - Failed to write destination value (@extended contains _RegWrite error code) @extended = 2 - Failed to open / create destination key (@extended contains RegCreateKeyExW return value) _RegWrite error code @extended = 5 --> RegOpenKeyEx access denied (error 5) reproduce code: (it's coping windows default sound scheme to current) Switch @OSArch Case "X64" $OSKey = "64" Case "X86" $OSKey = "" EndSwitch RegWrite("HKEY_CURRENT_USER" & $OSKey & "\AppEvents\Schemes", '', "REG_SZ", '.default') $i = 0 While 1 $i += 1 $subKEY_1 = RegEnumKey("HKEY_CURRENT_USER" & $OSKey & "\AppEvents\Schemes\Apps", $i) If @error <> 0 Then ExitLoop 1 $j = 0 While 1 $j += 1 $subKEY_2 = RegEnumKey("HKEY_CURRENT_USER" & $OSKey & "\AppEvents\Schemes\Apps\" & $subKEY_1, $j) If @error <> 0 Then ExitLoop 1 $copy_From = "HKEY_CURRENT_USER" & $OSKey & "\AppEvents\Schemes\Apps\" & $subKEY_1 & "\" & $subKEY_2 & "\.Default" $copy_To = "HKEY_CURRENT_USER" & $OSKey & "\AppEvents\Schemes\Apps\" & $subKEY_1 & "\" & $subKEY_2 & "\.Current" _RegCopyValue( $copy_From, "", $copy_To, "" ) ConsoleWrite("@error = "&@error&" @extended = "&@extended&@crlf) WEnd WEnd Edited January 8, 2014 by Iczer Link to comment Share on other sites More sharing options...
wraithdu Posted January 9, 2014 Author Share Posted January 9, 2014 This is not a UDF problem. It's what you say, you have an access denied error on your system for some reason. Link to comment Share on other sites More sharing options...
Iczer Posted January 10, 2014 Share Posted January 10, 2014 I do not think something can block regwrite so selectively since i'm on XP, i'm don't have AV, firewall have same permissions (verified) for AutoIt3.exe from both 3.3.8.1 and 3.3.10.2 and most impotant if i replace this: _RegCopyValue( $copy_From, "", $copy_To, "" ) with this: $value = RegRead($copy_From,"") $type = @extended Switch $type Case $REG_SZ $type = "REG_SZ" Case $REG_EXPAND_SZ $type = "REG_EXPAND_SZ" EndSwitch RegWrite($copy_To, "", $type, $value) it works perfectly in both 3.3.8.1 and 3.3.10.2 So if _RegCopyValue works in 3.3.8.1 and not in 3.3.10.2, it have to be UDF or realisation of dllcall in 3.3.10.2. i think. Link to comment Share on other sites More sharing options...
wraithdu Posted January 10, 2014 Author Share Posted January 10, 2014 If you can write up a working, non-destructive full reproducer, I'll take a look. But I only have win 8.1 x64, so I'm not sure if my results will mean much to you. Link to comment Share on other sites More sharing options...
ricky Posted February 17, 2014 Share Posted February 17, 2014 Hello, the function regexport doesn't work in my computer. I create a new using the export from windows : Func regExport($file, $key) Local $tempFile = @TempDir & "\regExportFunction.txt" Local $arrayFile, $Return if not FileExists($file) Then $Return = FileWrite($file, "Windows Registry Editor Version 5.00" & @CRLF & @CRLF) if $Return = 0 Then Return SetError(1,2,0) Endif RunWait(@ComSpec & " /c " & 'reg export "' & $key & '" "' & $tempFile & '"', "", @SW_HIDE ) if @error Then Return SetError(@error,0,0) $arrayFile = FileReadToArray($tempFile) if @error then FileWrite($file, "; [" & $key & "]" & @CRLF & "; Key does not exist" & @CRLF & @CRLF) Return 1 endif $Return = FileDelete($tempFile) if $Return = 0 Then Return SetError(1,1,0) For $i = 2 to Ubound($arrayFile) - 1 FileWrite($file, $arrayFile[$i] & @CRLF) if $Return = 0 Then Return SetError(1,3,0) Next Return 1 EndFunc Link to comment Share on other sites More sharing options...
LWC Posted April 6, 2014 Share Posted April 6, 2014 (edited) Just tried running it in the latest AutoIt (3.3.10.0) and got (since it's already defined in constants.au3 which the script includes): Global Const $REG_QWORD = 11 _RegFunc.au3"(20,29) : error: $REG_QWORD previously declared as a 'Const'. Edited April 6, 2014 by LWC 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