Prego Posted April 16, 2008 Share Posted April 16, 2008 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 More sharing options...
Will66 Posted April 16, 2008 Share Posted April 16, 2008 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 functionELSE Run("c:\Program Files\Pharos\bin\Uninst.exe", "", @SW_MAXIMIZE)EndIfFunc mytrueFunction() msgbox(0,"","Your statement was true")EndFunc Link to comment Share on other sites More sharing options...
Triblade Posted April 16, 2008 Share Posted April 16, 2008 (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 Edit: Added helpfile bit Edited April 16, 2008 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 More sharing options...
Prego Posted April 16, 2008 Author Share Posted April 16, 2008 thank you for the help. I am hopefull that this site and product can help me in more then just this one instance. Thanks 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