Fix _RegRead returns string data for _RegExport.
v2.0.6 - SCRIPT BREAKING
Change _RegRead treatment of REG_MULTI_SZ data. Data is returned in a comparable format to AutoIt's native RegRead function: CRLF delimited substrings. (AutoIt's RegRead actually returns LF delimited substrings.)
Added more supported formats to the Export function and fixed infinite loop errors. REG_LINK remains unsupported.
Fixed some REG_MULTI_SZ issues in Write/Copy/Move functions. Re-read the _RegWrite header notes for the pertinent information. Thanks again step887 for reporting.
Do not use RegDeleteKeyEx on 32-bit OS's, it is not needed (and does not exist on XP 32-bit and lower, or lower than Server 2003 SP1). Thanks step887 for reporting the error!
Fixed wrong @error return from _RegRead which would cause _RegValueExists to incorrectly return Success.
Ok, huge overhaul.
- Function documentation!
- Improved _RegRead and _RegWrite to better handle data. Specifically, REG_MULTI_SZ data types are correctly read / exported if the data was incorrectly written to the registry by another application. And the data is correctly written even if it was supplied to the function with incorrect termination. Because of the unusual format of this data type, it is returned from _RegRead as binary data.
- _RegRead / _RegWrite support all known registry value data types (in at a least a limited way). For uncommon types, the values are read / written as binary data.
- Better error checking and reporting, especially before any delete operations.
- x64 Platform: Support for directly reading the 32-bit and 64-bit registry views from both 32-bit and 64-bit scripts.
- All operations are now done via custom registry functions. I didn't want to go all the way, but AutoIt doesn't support a root key like HKLM32 to force reading the 32-bit registry on the x64 platform from a native 64-bit script. Once I decided to introduce that capability in some of the higher level functions, I had to rewrite all the low level functions as well.
- _RegExport function to recursively export a key or a single value to a MS compatible REG file.
- Other undocumented helper functions that could be pilfered for nefarious usage.
There might be some more minor things that I've forgotten. I've tested this pretty well, but please report any bugs or problems.
Added the latest version of this UDF. It includes some custom _RegWrite / _RegRead functions as well. The _RegWrite function allows you to set the REG_OPTION_VOLATILE flag on a registry key. Example at the bottom.
I needed this for a script, and didn't necessarily like big_daddy's solution. Here's a recursive registry copy/move function. I tested it and it seems to work perfectly (knock on wood). It could probably use some more error catching, so suggestions are welcome.
Edited by wraithdu, 02 February 2012 - 02:51 PM.