Sign in to follow this  
Followers 0
Illuvator

Question on Goto (which no longer exists)

4 posts in this topic

I want to write something which runs along the lines (Old version of Autoit):

IfExist, C:\\Files\\setup.exe, run, C:\\Files\\setup.exe

IfExist, D:\\Files\\setup.exe, run, D:\\Files\\setup.exe

IfExist, E:\\Files\\setup.exe, run, E:\\Files\\setup.exe

Basically, I want to change this to something like:

If("C:\\Files\\setup.exe")Then

Run("C:\\Files\\setup.exe")

Else

*Goto13*

EndIf

I want to make it do the following:

If C:\\Files\\setup.exe exists, then it runs the setup.exe

If it does not exist i want it to go to the next one down (see script above i.e. go to the D:\\Files\\setup.exe line) and so on running through the script

Is the way i have written it above (under I want to change this to something like) the right way to go about it, and if not how should i script this?

Thanks in advance

Illuvator

Share this post


Link to post
Share on other sites



Hi,

would that already help?

If FileExists("C:\Files\setup.exe") Then
    Run("C:\Files\setup.exe")
ElseIf FileExists("d:\Files\setup.exe") Then
    Run("d:\Files\setup.exe")
ElseIf FileExists("e:\Files\setup.exe") Then
    Run("e:\Files\setup.exe")
EndIf

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

would that already help?

Yes that would, thanks very much :o

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Also, u could use functions(like gotos)

If FileExists("File") then

_FileExists()

EndIf

Func _FileExists()

MsgBox(0, "", "")

EndFunc

Edited by CHRIS95219

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