Jump to content

RegWrite does not work properly

Recommended Posts

Hello guys,

I'm having a problem right here ..

I was trying to create a few Registry Values using autoit, but it seems to me that Autoit can't write those values to this specific part of the registry ..
Here is the code I'm trying to run:

RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\test\command", "", "REG_SZ", "C:\test\convert.exe %1 geojson|convert")

I'm definitly sure that the path is correct. Script is runned with Admin Rights. Everything's fine here.
It's possible to read other values stored by Windows in this directory:

MsgBox(0, 0, RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\Windows.burn", "Description"))

But you can't edit those using Autoit. I don't know what this is. In my eyes it's an Autoit Bug or something like that ...
Possible solution for me is to write a ".reg" file and run it afterwards, but this is an unclean method I don't really want to use ..

Any suggestions on this?


Edit: the OS is Windows 7 x64 German Language btw ..

Edited by Leo1906
Link to comment
Share on other sites

  • Developers

You probably are running this with the 32bit version of Autoit3, which would result you update the Wow6432Node branch of the hive.: 
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node \Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\test\command
Just check there to see if you can find your update.


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

Damn .. Yeah you're right :D

So I need to add a check on @OSArch and set the compile options to x64 I guess?
Or I make an x64 and an x32 Version of the program compiling it with the corresponding options ..

Link to comment
Share on other sites

You can access the 64-bit registry from a 32 bit script by adding "64" to the registry path.  Look under remarks in the help file for accessing the 64-bit registry.  

Local $s64Bit = ""
If @OSArch = "X64" Then $s64Bit = "64"
RegWrite("HKEY_LOCAL_MACHINE" & $s64Bit & "\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\test\command", "", "REG_SZ", "C:\test\convert.exe %1 geojson|convert")




Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...