Jump to content

Recommended Posts

Posted (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 by autoitNOW
An ADVOCATE for AutoIT
  • 3 weeks later...
Posted

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.

Posted

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 supported

So just check if @error is 1 or -1. This should do the trick.
Posted

Then check your help file. I just redownloaded the stable helpfile and RegRead has the same @error codes... helpfile reading helps.

Posted

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.

Posted

Heheh, i thought it was a little old... ive just been trawling the forum for all unanswered posts.

Sitting comfortably behind the code.

Posted (edited)

$mom = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "Start Page")

IF $mom = "http://www.microsoft.com" THEN Exit

Edited by Doxie

Were ever i lay my script is my home...

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...