Grof Posted June 21, 2019 Share Posted June 21, 2019 hello, I have a problem... I have a registry key (ex HKCU\Software\MyApp) I have to rename it in HKCU\Software\MyApp_Backup, and then move (from portable) a new RegKey to replace the original one renamed. After RunWait I have to backup the portable key and rename the old key to original name. in function: https://www.autoitscript.com/autoit3/docs/functions/ I haven't found RegRename, RegMove or similar... How can I reach my goals??? Link to comment Share on other sites More sharing options...
Developers Jos Posted June 21, 2019 Developers Share Posted June 21, 2019 So what did you find that is possible to manipulate the Registry in the helpfile that also might accomplish what you want? .... and why exactly do you want this at all? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Grof Posted June 21, 2019 Author Share Posted June 21, 2019 "and why exactly do you want this at all?" As I have written in my first post, I want create a launcher for portabilize apps, but I have seen until now only basic code... Like this: RunWait("regedit.exe /s Portable.reg", @ScriptDir) RunWait("App\talisman.exe") RunWait('regedit.exe /s /e "' & @ScriptDir & '\Portable.reg" "HKEY_CURRENT_USER\Software\JetCar"') RunWait("regedit.exe /s Portable2.reg", @ScriptDir) RegDelete Deletes a key or value from the registry. RegEnumKey Reads the name of a subkey according to its instance. RegEnumVal Reads the name of a value according to its instance. RegRead Reads a value from the registry. RegWrite Creates a key or value in the registry. I have found tools for edit value more than entire keys. Is there a way to realize in AutoIt what I' m looking for? Link to comment Share on other sites More sharing options...
Developers Jos Posted June 21, 2019 Developers Share Posted June 21, 2019 (edited) There is no move as that is not a standard function , but would think that a RegRead -> RegWrite and then RegDelete would be the same result ...no? ... but no options to move keys as far as I know. Jos Edited June 21, 2019 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Grof Posted June 21, 2019 Author Share Posted June 21, 2019 (edited) I've thinked at this possibility but there are some problems... If I write RegRead ""HKCU\Software\MyApp") exit error missing parameter (Value), so I have to read value-by-value the whole key... And after this I have the problem of change the name of the new key... Any idea or suggestion??? Edited June 21, 2019 by Grof Link to comment Share on other sites More sharing options...
Earthshine Posted June 21, 2019 Share Posted June 21, 2019 (edited) duplicating keys in AutoIt is very possible. it's pretty straightforward this thread deals with key duplication, you would just add a delete part, and modify the AutoIt code to read/write the correct keys This next thread deals with basically same thing, save a key to another key, which is closer to your goals I am betting Edited June 21, 2019 by Earthshine My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
TheXman Posted June 21, 2019 Share Posted June 21, 2019 (edited) What you are trying to do, as it relates to creating portable apps, looks similar to the methodology used by PortableApps.com. However, they backup a copy of the relevant registry, appdata, and other state and config information to a file structure under the portable app's folder. As far as backing up or renaming registry keys, you could look into using the REG.EXE command. As you can see below, it can do everything you have said that you need to do and it comes with Windows. If it is just a matter of capturing the prior state of the registry, it is probably safer to export the key(s) at launch and import/restore them back upon exit. The less you mess with the registry, the better. REG Operation [Parameter List] Operation [ QUERY | ADD | DELETE | COPY | SAVE | LOAD | UNLOAD | RESTORE | COMPARE | EXPORT | IMPORT | FLAGS ] Return Code: (Except for REG COMPARE) 0 - Successful 1 - Failed For help on a specific operation type: REG Operation /? Examples: REG QUERY /? REG ADD /? REG DELETE /? REG COPY /? REG SAVE /? REG RESTORE /? REG LOAD /? REG UNLOAD /? REG COMPARE /? REG EXPORT /? REG IMPORT /? REG FLAGS /? Edited June 21, 2019 by TheXman CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman Link to comment Share on other sites More sharing options...
Grof Posted June 21, 2019 Author Share Posted June 21, 2019 Thanks to everybody. I need few time to verify if I can manage this code (I'm a newbie). Yes, I want create something like PortableApps, or better, NSIS. TheXman, what is Reg.Exe command? Where can I find manuals, guide or tutorial? Link to comment Share on other sites More sharing options...
TheXman Posted June 21, 2019 Share Posted June 21, 2019 2 minutes ago, Grof said: TheXman, what is Reg.Exe command? Where can I find manuals, guide or tutorial? As I said, it comes with Windows. As far as where you can find more info on it, have you ever heard of Google, Bing, Yahoo, etc.? You could start by typing "reg.exe /?" in a CMD console or you could look on the Microsoft site, like HERE. CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman Link to comment Share on other sites More sharing options...
Grof Posted June 21, 2019 Author Share Posted June 21, 2019 OK. Link to comment Share on other sites More sharing options...
TheXman Posted June 21, 2019 Share Posted June 21, 2019 (edited) 22 minutes ago, Grof said: Yes, I want create something like PortableApps, or better, NSIS. NSIS, as far as I'm aware, creates installers for applications. It has nothing to do with making an application portable. There's even a portable version of NSIS on PortableApps.com. Edited June 21, 2019 by TheXman CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman Link to comment Share on other sites More sharing options...
Subz Posted June 23, 2019 Share Posted June 23, 2019 I still use Wraithdu RegFunc UDF (see link below), _RegMoveKey should do what you're after, the UDF also includes RegExport function and a number of other useful registry functions like _RegKeyExists, RegValueExists. 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