Jump to content

Very simple question about NOT


Saytun
 Share

Recommended Posts

In the script I am making, I need it to check the registry for a value. If it is there, it would go on with the rest of the program. If it isn't, then it would use RegWrite to put the registry value there, then go on.

However, I am having trouble doing this ><

Normally, I'd do something like:

$reg = RegRead ( "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "" )

If $reg =/= "C:\Program Files\AATOOL\AATool.exe" Then

RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "", "REG_SZ", "C:\Program Files\AATOOL\AATool.exe"")

But there is no "=/=" or any other "does not equal" operator in AutoIt (at least that I am aware of.

So I tried:

If $reg NOT = "C:\Program Files\AATOOL\AATool.exe" Then

But that doesn't work properly :lmao:

So I guess my question is:

How would I properly use NOT in this case? Yes, I've read the manual and looked through the examples, and nothing

Link to comment
Share on other sites

If $reg <> "C:\Program Files\AATOOL\AATool.exe" Then

....

If Not ($reg = "C:\Program Files\AATOOL\AATool.exe") Then

<{POST_SNAPBACK}>

Agh, the "<>" operator must have slipped past me.

Thanks for the help, I need to read more carefully next time =(

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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