Sign in to follow this  
Followers 0
philipharvey

Create registry key?

11 posts in this topic

Is there a simple way to create a completly empty registry key in autoit? The only way I can figure to do this is to create a value and then delete it. e.g.

RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Test","junk","REG_SZ","")
RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Test","junk")

If you simply do

RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Test","","REG_SZ","")

then the keys default value does not seem to get set (or rather not set) correctly.

Cheers

Philip

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Strange and true...

What about a UFD?

Func _RegWriteEmptyKey($KeyName)
    RegWrite("$KeyName","junk","REG_SZ","")
    Return(RegDelete("$KeyName","junk"))
EndFunc
Edited by ezzetabi

Share this post


Link to post
Share on other sites

Hi ezzetabi.

I realize I could write a function to do this, but what I was getting at was is this a bug in Autoit that could be fixed?

Or perhaps a missing feature that could easily be added?

Or perhaps someone knows how to do this but it isn't documented?

Cheers

Phil

Share this post


Link to post
Share on other sites
:D:huh2: Sorry... I just wanted to help...

Share this post


Link to post
Share on other sites

Hi ezzetabi.

I wasn't meaning to jump down your throat, any help is always appreciated.

Cheers

Philip

Share this post


Link to post
Share on other sites

I've made RegWrite accept a single parameter as a key to create without setting any values.  It will be available the next time I upload an unstable version.

Thank you.

Share this post


Link to post
Share on other sites

Super news Jon, thanks for looking into this.

Cheers

Phil

Share this post


Link to post
Share on other sites

Just a vote of thanks from someone who uses the capabilities of AutoIt3 to read and update the Windows registry a lot. I must say that AutoIt is really great at doing this! I have found it a dream to code and works really well. I have used some computer languages where the registry syntax is almost incomprehensible and a nightmare to debug. I won't mention names in case I attract a whole heap of flame messages, but I think you will be able to see what I mean. (Whoops, no pun intended). :ph34r:


Computers don't solve problems, they just rearrange them.New string TRIM() functions for AutoIt3

Share this post


Link to post
Share on other sites

Just a vote of thanks from someone who uses the capabilities of AutoIt3 to read and update the Windows registry a lot.

By the way, there are some good scripts by Dan et al. for converting .reg files to autoit3 scripts. Just letting you know; I think it's gotten buried in the scripts and scraps forum.

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
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
Sign in to follow this  
Followers 0