Guest atenspro Posted August 26, 2005 Share Posted August 26, 2005 I modified the example in the help under "Registry Management" for RegDelete to create a script. It works fine and deletes the registry value I need to delete. But it doesn't give me a return value, or at least I can't see the return value (or maybe I don't know where to look for the return value?). It would be great to see a value to know it was successful instead of using regedit to verify it. I may be doing it all wrong. But it does delete the value. Here is my script: RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "MyValue") If it's possible, I would like to see these values taken from the help file for AutoIt: Return Value: Success: Returns 1. Special: Returns 0 if the key/value does not exist. Failure: Returns 2 if error deleting key/value. I apologize if my question isn't clear. If you need more info just ask. Thanks in advance for any help you can give me. Link to comment Share on other sites More sharing options...
GaryFrost Posted August 26, 2005 Share Posted August 26, 2005 $val = RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "MyValue") MsgBox(0,"Value",$val) SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Guest atenspro Posted August 26, 2005 Share Posted August 26, 2005 $val = RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "MyValue") MsgBox(0,"Value",$val)<{POST_SNAPBACK}>It worked! Thanks for "schoolin me" Link to comment Share on other sites More sharing options...
Guest atenspro Posted August 26, 2005 Share Posted August 26, 2005 Now I have another question. Is there a way to get a return value that spells it out rather than just a number? I mean that says "Successfully deleted" or "Value does not exist" or "Error deleting value". Thanks again for your quick response and the correct answer to my first question. Link to comment Share on other sites More sharing options...
SupraNatural Posted August 26, 2005 Share Posted August 26, 2005 Yea, for example if $val = 1 then msgbox(0,"Success","Successfully deleted") endif Visit http://www.blizzedout.com/forums/register....referrerid=8306 for the top blizzard hacks. WoW, TfT, D2/LOD, CS. You name it we got it! Link to comment Share on other sites More sharing options...
GaryFrost Posted August 26, 2005 Share Posted August 26, 2005 Normally no, usually a scripter creates conditions example $val = RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "MyValue") if $val = 0 then MsgBox(0,"RegDelete","key/value does not exist") elseif $val = 1 then MsgBox(0,"RegDelete", "Successfull") elseif $val = 2 then MsgBox(0,"RegDelete", "error deleting key/value") endif SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Guest atenspro Posted August 26, 2005 Share Posted August 26, 2005 gafrost.....Thanks again! It's been many years since I played around with "Basic" but this reminds me of that time. Your conditional statements were perfect for what I was trying to do. Thanks again for taking the time to spell it out for me. 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