Nova Posted October 11, 2004 Posted October 11, 2004 (edited) Hi im trying to write a script to check to see if a reg key exists, and if it dosent create the missing key RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "A") If @error = 0 Then MsgBox(4096, "Yes") Else MsgBox(4096, "No") Endif Can someone explain why the above code dosent do so ? Edited October 11, 2004 by nova
JSThePatriot Posted October 11, 2004 Posted October 11, 2004 This is how to do that properly.. you never told it to write a key you are just reading to see if it is there... If Not(RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "IPSend.exe")) Then RegWrite("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "IPSend.exe", "REG_SZ", @ScriptFullPath) EndIF Hope this helps a bit, JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)
Nova Posted October 11, 2004 Author Posted October 11, 2004 (edited) Edit: Mistake ! Edited October 11, 2004 by nova
Developers Jos Posted October 11, 2004 Developers Posted October 11, 2004 (edited) Hi im trying to write a script to check to see if a reg key exists, and if it dosent create the missing keyRegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "A") If @error = 0 Then MsgBox(4096, "Yes") Else MsgBox(4096, "No") EndifCan someone explain why the above code dosent do so ?<{POST_SNAPBACK}>Think you have a syntax error in the MSGBOX() commands....When thats fixed it works for me... Edited October 11, 2004 by JdeB 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.
Nova Posted October 11, 2004 Author Posted October 11, 2004 Think you have a syntax error in the MSGBOX() commands....Dammit, I hate getting the simple stuff wrong, thats what happens when you rush Tnx
JSThePatriot Posted October 11, 2004 Posted October 11, 2004 I dont understand what the above code is doing... JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)
Developers Jos Posted October 11, 2004 Developers Posted October 11, 2004 I dont understand what the above code is doing...JS<{POST_SNAPBACK}>Only tests if the registry key exists.... normally you would do something like this i guess;$a = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "A") If @error = 0 Then MsgBox(4096, "Yes", $a) Else MsgBox(4096, "No", "no") EndIf 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.
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