Jump to content

Recommended Posts

Posted

If FileExists("http://XXXX.com/Files/WOW.exe") Then

InetGet("http://XXXX/Files/WOW.exe", "C:\Installer\WOW.exe")

Else

MsgBox(4096,"Installer", "Does NOT exists")

EndIf

how can i declare the if the file exist in the site flesExists Read on local Drive.

can some one elp me

Posted (edited)

Maybe use "InetGetSize" to try and retrieve the file size, if the call errors, then the file likely doesn't exist?

Edited by Spiff59
Posted (edited)

Maybe use "InetGetSize" to try and retrieve the file size, if the call errors, then the file likely doesn't exist?

fileexist is only for local so hard drive usb key or external hdd netwerk does olso work but not http

try this

if InetGetSize("http://www.autoitscript.com/autoit3/files/beta/update.dat") <> 0 then 
InetGet("http://XXXX/Files/WOW.exe", "C:\Installer\WOW.exe")
Else
MsgBox(4096,"Installer", "Does NOT exists")
EndIf
Edited by yucatan
Posted

If InetGetSize("http://www.autoitscript.com/autoit3/files/beta/update.dat") <> 0 then

If FileExists("C:/Files/WOW.exe") Then

exit

else

InetGet("http://XXXX/Files/WOW.exe", "C:\Installer\WOW.exe")

endif

is this gonna work? im in shop im not yet go home.

Posted (edited)

So, another requirement is that you don't want to download it if it's already on your C: drive?

If so, I wouldn't bother banging on the internet until after you've checked that.

Also, you dont need <> 0, letting it test the boolean (zero/non-zero) result is enough.

If Not FileExists("C:/Files/WOW.exe") Then
    If InetGetSize("http://XXXX/Files/WOW.exe"") Then 
        InetGet("http://XXXX/Files/WOW.exe", "C:\Installer\WOW.exe")
    EndIf
EndIf
Edited by Spiff59

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
×
×
  • Create New...