autoitNOW Posted July 1, 2004 Share Posted July 1, 2004 (edited) Hi, Does anyone know the best way to handle a situation where an autoit script looks for a certain registry key and if it finds it than exits? Any workarounds for If RegKeyExists and RegValueExists type functions? Thanks in advance Edited July 1, 2004 by autoitNOW An ADVOCATE for AutoIT Link to comment Share on other sites More sharing options...
Davman Posted July 22, 2004 Share Posted July 22, 2004 Yeah.... Last time i checked i couldnt make autoit search the registry, so my amazing workaround is: run regedit, export to .reg file, rename to .txt open with notepad, scroll through each line, copy to clipboard, maniuplate string to get the keynames. Much fun it is too. I wrote a little app to wipe out registry entries of virus's that Sophos Antivirus picks up. Sitting comfortably behind the code. Link to comment Share on other sites More sharing options...
sugi Posted July 22, 2004 Share Posted July 22, 2004 I don't know about the stable version but in the unstable version RegRead has a few nice @error-codes:Success: Returns the requested registry value value.. Failure: Returns numeric 1 and sets the @error flag: 1 if unable to open requested key -1 if unable to open requested value -2 if value type not supportedSo just check if @error is 1 or -1. This should do the trick. Link to comment Share on other sites More sharing options...
Davman Posted July 22, 2004 Share Posted July 22, 2004 Heheh... i still havent dared to download the unstable build... Sitting comfortably behind the code. Link to comment Share on other sites More sharing options...
sugi Posted July 22, 2004 Share Posted July 22, 2004 Then check your help file. I just redownloaded the stable helpfile and RegRead has the same @error codes... helpfile reading helps. Link to comment Share on other sites More sharing options...
Davman Posted July 22, 2004 Share Posted July 22, 2004 My bad, i read his question wrong... i thought he said an "uncertain" registry key... i.e, he knew the value of the key, but not the keyname... and yes, your correct its in the helpfile, and yes, i read your post wrong too, i thought you were reffering to the unstable RegSearch. Sitting comfortably behind the code. Link to comment Share on other sites More sharing options...
autoitNOW Posted July 22, 2004 Author Share Posted July 22, 2004 This was back when I was even newer to AutoIt. RegRead, RegEnumVal, & RegEnumKey will work. An ADVOCATE for AutoIT Link to comment Share on other sites More sharing options...
Davman Posted July 22, 2004 Share Posted July 22, 2004 Heheh, i thought it was a little old... ive just been trawling the forum for all unanswered posts. Sitting comfortably behind the code. Link to comment Share on other sites More sharing options...
Doxie Posted July 23, 2004 Share Posted July 23, 2004 (edited) $mom = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "Start Page") IF $mom = "http://www.microsoft.com" THEN Exit Edited July 23, 2004 by Doxie Were ever i lay my script is my home... 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