Sign in to follow this  
Followers 0
Prego

newbi needs help

4 posts in this topic

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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

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)

Share this post


Link to post
Share on other sites

thank you for the help. I am hopefull that this site and product can help me in more then just this one instance.

Thanks

Share this post


Link to post
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
Sign in to follow this  
Followers 0