supraspecies Posted May 17, 2014 Posted May 17, 2014 Hi. Just as topic name says, I need to delete registry key only if its empty. There is this topic: But no, I don't know all the values that would possibly exist in this key. So any other way?
Developers Jos Posted May 17, 2014 Developers Posted May 17, 2014 Have you looked at RegEnumKey or RegEnumVal to find all possible keys/values in the helpfile? 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.
Solution supraspecies Posted May 17, 2014 Author Solution Posted May 17, 2014 (edited) Yes, thanks. Was able to come up with a solution: RegEnumKey ('HKCU\Software\techPowerUp', 1) $nokeys=(@error=-1) RegEnumVal ('HKCU\Software\techPowerUp', 1) $novalues=(@error=-1) If $nokeys And $novalues Then RegDelete ('HKCU\Software\techPowerUp') I was trying to delete empty "techPowerUp" key. With the above code, it deletes only if there are no keys and values in it. Let the code be here for anyone who needs it since I wasn't able to find an answer when I searched. Edited May 18, 2014 by supraspecies
Palestinian Posted May 17, 2014 Posted May 17, 2014 Please mark the topic as "Solved" for everyone else to know.
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