Method Reference (COM)

URLDownloadToFile

Downloads a file from the internet.

URLDownloadToFile ( "URL", "filename" )

 

Parameters

URL URL of the file to download.
valuename Filename to download to.

 

Return Value

Success: Returns 1.
Failure: Returns 0.

 

Remarks

Internet Explorer 3 or greater must be installed for this function to work. Firewalls or presence of multiple network adapters may cause this function to fail. Also, some websites may block such downloads.

The file is obtained from IE cache whenever possible. You might be able to force a (re)download from the internet by supplying a fake cgi parameter, for example: "http://.../test.exe?fakeParam=42"

 

Related

None.

 

Example

Set oAutoIt = WScript.CreateObject("AutoItX3.Control")
oAutoIt.URLDownloadToFile "http://www.mozilla.org", "C:\foo.html"
oAutoIt.URLDownloadToFile "http://www.hiddensoft.com", "C:\mydownload.htm"