Jump to content

newbi needs help


 Share

Recommended Posts

Hello, i am new to programming and AutoIT but if looks like a product i woudl like to use in automating an uninstall of a product and then a reinstall of a newer version. I need help with an IF THEN statement. Basically I need it to look for a file if it is ther run it if not move on to a later line of code. is this possible.

If FileExists('c:\Program Files\Pharos\bin\Uinst.exe') = 0 Then (move to line 50)

ELSE Run("c:\Program Files\Pharos\bin\Uninst.exe", "", @SW_MAXIMIZE)

How would i end the first line since i knwo it is not right. Thanks in advance for the help.

Link to comment
Share on other sites

Hello, i am new to programming and AutoIT but if looks like a product i woudl like to use in automating an uninstall of a product and then a reinstall of a newer version. I need help with an IF THEN statement. Basically I need it to look for a file if it is ther run it if not move on to a later line of code. is this possible.

If FileExists('c:\Program Files\Pharos\bin\Uinst.exe') = 0 Then (move to line 50)

ELSE Run("c:\Program Files\Pharos\bin\Uninst.exe", "", @SW_MAXIMIZE)

How would i end the first line since i knwo it is not right. Thanks in advance for the help.

Then (move to line 50)....nearly the right logic.

Look to call a function if the statement is true:

If FileExists('c:\Program Files\Pharos\bin\Uinst.exe') = 0 Then

call("mytrueFunction") ;call some function

ELSE

Run("c:\Program Files\Pharos\bin\Uninst.exe", "", @SW_MAXIMIZE)

EndIf

Func mytrueFunction()

msgbox(0,"","Your statement was true")

EndFunc

Link to comment
Share on other sites

AutoIt doesn't support Goto commands because the makers find them useless or something like that.

Anyway, it's just not included.

(See the AutoIt Helpfile -> Frequently Asked Questions (FAQ) -> Question 4)

See Will66's example for the example :D

Edit: Added helpfile bit

Edited by Triblade

My active project(s): A-maze-ing generator (generates a maze)

My archived project(s): Pong3 (Multi-pinger)

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...